-
-
Notifications
You must be signed in to change notification settings - Fork 97
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make the TabContainer node use Tabs internally, instead of its own implementation #2514
Comments
I would actually call them annoyingly different, which is why we have issues like #2287, #2250, and probably some others in the same vein. I think I've addressed all 3 of your problems in #2129 (comment), but to reiterate:
I would also add that if we are to rely on
|
TabContainer
use Tabs
internally, instead of its own implementation
Implemented by godotengine/godot#58687. |
Describe the project you are working on
The Godot Engine™.
Describe the problem or limitation you are having in your project
Currently,
TabContainer
has its own tab system implementation, one which basically copies everything fromTabs
, which means that there is two implementations of the exact same thing, and both need to be updated when adding functionality. This adds unnecessary extra work for their maintenance.Describe the feature / enhancement and how it helps to overcome the problem or limitation
The solution would be making
TabContainer
useTabs
internally, removing the need of two different implementations. That, however, is more complex than it seems, as written in the next section.Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
Basically, it would happen by adding a
Tabs
node as a child ofTabContainer
, remove the existing code, and pass the commands to that instead. But this brings some problems:TabContainer
s, the workflow used by people (and Godot's own codebase) is by using child manipulation functions (add_child()
,get_index()
,get_child_count()
, etc) with it, since it's aContainer
derived node. The problem is that addingTabs
to it shoves a wrench in the machine, since those functions can't be relied upon anymore without a bit of extra hacking. This problem could be completely solved if Add support for internal nodes godot#30391 was to be merged.Tabs
,TabContainer
also has the same majority of functions and enumerations that the former has, including theme styling. What should be done about that? Just make those link to theTabs
node internally, which means two things still need to be updated, even if to a lesser extent? Or expose the node itself, which would open a complete new can of worms?There's the possibility that more problems could come up later, but you get the point. I'm trying to tackle this problem since a long time, but doubts on how to deal with those hurdles stops me in my tracks, so I opened this proposal as a form of discussion on how this could be done (and if the task is worth the trouble to begin with).
If this enhancement will not be used often, can it be worked around with a few lines of script?
It's something internal, so no.
Is there a reason why this should be core and not an add-on in the asset library?
It's about a core feature itself.
The text was updated successfully, but these errors were encountered: