-
-
Notifications
You must be signed in to change notification settings - Fork 98
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
Allow TabContainers to position some child nodes in the tabs bar #2250
Comments
Duplicate of #2129 (comment)? |
Not exactly, but as an alternative solution, maybe. |
tab seperation would also be nice to have, where we could define some value to put in between the tabs, like a spacer, would give us the option to make the ui more unique/modern, depending on design choices |
@groud I've just ran into the need for something like this myself, but now I don't get what you mean here. The three dots button are exposed to the As I now see it, we can easily introduce a couple of configuration options to this to achieve the results we need. Namely, it needs a way to set the icon and a way to change its position. Currently it is always added to the far right, but we can introduce other variants, such as "far left", "to the left of tabs", and "to the right of tabs". The benefit here would be keeping the existing functionality and not relying on child positioning. So it would be, in GDScript, like this: var popup_menu = PopupMenu.new()
add_child(popup_menu)
set_popup(popup_menu)
set_popup_icon(get_icon("Add", "EditorIcons"))
set_popup_button_position(RIGHT_OF_TABS) This can all be done without even breaking the compatibility. If we were to break it, And I don't think that we need more than one button in most cases, but if we do and we do want to break compat, we can make position to be the essential part of setting a popup/button. Something like set_popup(RIGHT_OF_TABS, popup_menu)
set_popup_icon(RIGHT_OF_TABS, get_icon("Add", "EditorIcons")) |
Ah I did not know that. I though this was using the Tab node instead.
My proposal would not break compatibility. The fact is I need more than one button, as I want to use it to position a toolbar. |
I see, so you want a completely custom control there, not just a single button. If I'm being honest, this feels like an overkill to me, mixing tabs with a toolbar. I see the appeal of compactness, but I'm not sure that's the best UX setup.
Well, it appears your proposal conflicts with the existing functionality, that is used for docks. And to realize it the way you need it, we would have to replace it. Otherwise we'd be left with two ways to do the same thing, one with a bit more flair than the other. Can you reconsider your toolbar into something like a |
Compactness is very important. And this would help me make the bottom editor a lot more compact. Remember a lot of people are using Godot on 13" laptop screens. In my case, I wont keep a full toolbar on the top of TabContainer with only two tabs. Se this screenshot: I don't think this is acceptable.
No, I'll go for the Tabs node if I cannot do it with a TabContainer. A toolbar cannot go inside a PopupMenu.
This is not a problem. We could either automatically convert things to the new system, or simply leave both solutions exist and mark the old method as deprecated. So technically, there's not compatibility breakage in adding those two properties. I mean, the goal of this proposal is to simply make easier something we already do in the editor in several places. I believe the use case is common enough in the editor for adding such feature to TabContainer. But if we don't go for it then that's ok, I'll simply use Tabs instead or find another solution, it's just more work and some duplicated LoC, but that's not a big deal. |
Describe the project you are working on
Godot
Describe the problem or limitation you are having in your project
While working on the editor, I often want to be able to add some controls next to tabs. It is technically possible by using Tabs nodes, but it does not provide the ease of use TabContainers are useful for.
Describe the feature / enhancement and how it helps to overcome the problem or limitation
To simplify this use case, I would like to add an option to TabContainers allowing to use the first one or two children to be placed in the tabs bars, next to the tabs. We have something similar in the editor, but they cannot use a TabContainer. Here with the buttons with 3 dots:
Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
I think the way to expose this option would be an enum with 4 values:
We could use two booleans too, that would work too I suppose. Additionally with booleans, we could also allow two other areas behaving the same way, but next to the tabs. That would allow for something similar to the plus button we have in the editor, next to scenes tabs.
If this enhancement will not be used often, can it be worked around with a few lines of script?
I guess, at least it would be used often in the editor. Can be workarounded but it's not easy to do.
Is there a reason why this should be core and not an add-on in the asset library?
This is core.
The text was updated successfully, but these errors were encountered: