-
-
Notifications
You must be signed in to change notification settings - Fork 21.5k
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 text tooltip for TabBar & TabContainer #89247
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks pretty clean, and the feature makes sense. I'm surprised we didn't have it yet :D
I remember there was some discussion going in the past. Something about tooltips that only repeat the hovered subject being very annoying and superfluous. I wouldn't want to contribute to that by default as by this PR does (and as by KoBeWi's screenshot shows). |
I think those tooltips have a place when the tab's text is truncated, but yeah, it currently just shows it no matter what. |
+1 to Mickeon's point. Tooltips will hijack 'ui_cancel' to close the tooltip. Select a node and then have your cursor over a tool mode button w/ the tooltip visible, then press escape (the default) to try to unselect the node, and you'll see what I mean. I don't have an opinion on that specific behavior, but I do believe that it should be minimized, by not having tooltips showing redundant information scattered around the editor. |
Point is, regarding this specific PR, the default behavior should be no tooltip at all (in my opinion) |
I reworked the code and now tooltips shows tab title only if text is truncated. |
I think that makes sense, it's desirable and expected. |
I'm not even sure how to make a tab truncated, as tabs simply disappear if they have no space. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The above code needs figuring out
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The tooltip text should be carried over in TabContainer::move_tab_from_tab_container()
so that dragging across different containers work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs a rebase, otherwise looks good.
@timothyqiu done! |
Thanks! |
Also for the record, it doesn't seem possible to disable this behavior if you're using |
See: So to me, if it's really just showing the tab's name, it's pretty undesirable and should be fixed. |
Tooltips are only shown if the tab content is cut off, this only happens if the |
Closes godotengine/godot-proposals#9252