Add an option to disable the built-in tooltip popups for Control #10639
harrison-munitz
started this conversation in
GUI
Replies: 1 comment
-
I guess this would also be doable and potentially more customisable with per-Control tooltip timers. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Proposal
Add a new boolean property to
Control
which completely disables all built-in tooltip behavior, but leaves thetooltip_text
property usable for custom implementations. (e.g.tooltip_enabled
,show_tooltip
,use_native_tooltip
, etc.)Context
By default, if a
Control
node has itstooltip_text
property set to anything except the empty string, then a popup will show up containing that text when you hover the node.When creating a custom tooltip implementation, this is not always desirable. A particular example is when you want to have all tooltips show in a single preset text-box somewhere else on screen. The current custom-tooltip implementation does not support this (or not easily) as it only supports using the
Popup
.Even with this implementation, the popup style tooltip will still show up when you hover the node by default. The only way to stop this behavior is to create a custom class extending that node. Then you can either use a custom property or, the better solution in my opinion, define the virtual
_get_tooltip()
method and return the empty string, thus disabling the popup completely.E.g.
This DOES work, but it's really annoying. For every type of
Control
node I ever want to have a non-popup tooltip, I have to create a wrapper class whose only job is to disable the tooltip. It would be a massive QOL improvement if I could just use the built-in types, which already do everything I want except for this one thing.Source-Code Changes
I'm not well versed in C++ or the engine's inner-workings, so I don't feel comfortable creating a pull request to make the change myself but, at a glance it seems like, other than creating the boolean property itself (
tooltip_enabled
in my example), the change could be implemented by adding the following togodot/scene/gui/control.cpp:3157
, in the methodControl::get_tooltip
, just before the_get_tooltip
virtual call.This change should work without having to modify any other behavior, since the empty string is already the value which means "don't show the tooltip".
Beta Was this translation helpful? Give feedback.
All reactions