-
-
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
Add vertical_mode
toggle to TabBar
#5031
Comments
I was looking into implementing vertical tabs for the scene tabs and was surprised to see this feature missing in the tab bar control. Would help in making this an option for the editor more easily! From a brief look at the code, the tab bar implements a lot of things manually (especially tab rendering). Seems like it needs a bit of a rewrite, if we don't want to double the code's size. Another note: The API changes must also apply to |
This would suggest the first method or a modified version of it would be most optimal, especially in replicating the function found in the rest of the engine, though for consistency sake it would technically require that TabBar be referred to as HTabBar which I don't think can happen any time soon.
I'll add that as a consideration. As for the second part of that, if a feature similar to #3558 (comment) were to be done instead, this could make the first method the most optimal, however as that would still make TabBar uniquely violating of the style of the other oriented controls, and according to #3558 (comment) it kind of violates the spirit of the oriented control nodes having one orientation being more prevalent then another. (even if in this case that is strictly true as this is the first issue on the subject) All that said, with the current state, I'm not sure if whether the first or third method would work better in following the the desires of the engine. A maintainer should probably comment on this. |
It should just be a toggle in the TabBar itself. The drawing logic is pretty much the same, except we don't draw text vertically and x and y are swapped in the algorithms. Even if we end up exposing HTabBar and VTabBar as individual nodes, none of the existing H/V nodes splits the code into two. There is always one underlying node with all the code and the other variant (typically V) is just a node with a flag preset to true. So sure, feel free to add a togglable vertical mode to TabBar. And yes, here we can definitely assume that horizontal is a more widespread orientation and can be the default. |
Alright, I'll update the the proposal to remove everything but method 2 then setup a PR for it. |
Describe the project you are working on
A text-centric social deduction games somewhat similar to Werewolf/Mafia.
Describe the problem or limitation you are having in your project
TabBar only functions to create horizontal tab bars, usually above the tab's content, however I seek a vertical bar with tabbing to sit on the left or right side of the content instead.
Describe the feature / enhancement and how it helps to overcome the problem or limitation
Implement a
vertical_mode
toggle and a hiddenvertical_tab_alignment
enum value that only appears if in vertical mode onto the TabBar.max_tab_width
can remain unchanged.Considerations
max_tab_height
be added? (it should only appear invertical_mode
)Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
It would have a
vertical_mode
property and would hidetab_alignment
for atab_vertical_alignment
:If this enhancement will not be used often, can it be worked around with a few lines of script?
Not exactly a few lines, but it could somewhat similarly be implemented with a VBoxContainer and a bunch of buttons at the least.
Is there a reason why this should be core and not an add-on in the asset library?
All these behaviors would require re-implementing TabBar in some manner to get parity, TabBar already retains pretty much everything structurally for this behavior and a manner to make it easy to use, and as far as I can see it only needs some modifications to enable this functionality, as well this would be a useful GUI tool to have for lists of toggleable menus where the current TabBar may not be as suited for the case.
The text was updated successfully, but these errors were encountered: