godot icon indicating copy to clipboard operation
godot copied to clipboard

Add Control method to show tooltip with no delay & display tooltips instantly when adjacent

Open Mickeon opened this issue 3 years ago • 3 comments

This PR adds a new exposed method to Control called show_tooltip().

It forces the tooltip to display regardless of settings.

While this may sound utterly situational, and it certainly may be... First, I need this feature for a future PR. Second, This PR also makes use of its new internal property to fix this annoyance:

Before After
Before After

Instead of remaining the same, if the tooltip popup is visible and has changed, it is refreshed instantly.

Note that, this doesn't work with custom tooltips, and only works adequately if there's little to no margin between "different tooltips". During movement, the mouse is bound to land on empty space, which always clears the tooltip. I was testing ways to combat this, but it may be too undesired. Finally, the previous behaviour may possibly be intentional (but still rather strange). This PR's behaviour is not nearly as useful on the File System for example (not that it was before), but it opens the door for more intricate tooltips beyond the full name, and ways to display said tooltips more consistently.

File System

Mickeon avatar Aug 23 '22 17:08 Mickeon

Seems ok, but needs rebase.

KoBeWi avatar Dec 06 '22 12:12 KoBeWi

In a PR meeting it was discussed that https://github.com/godotengine/godot/pull/64799 was UX never used in the rest of the editor. Because this PR heavily relied on #64799 to have legs to stand on... it seems like there's uncertainty in the implementation. The "display tooltips instantly when adjacent" part of this could be split and implemented differently, too, perhaps...

Mickeon avatar Dec 06 '22 12:12 Mickeon

Yeah the method to show tooltip instantly probably warrants a proposal. It might be useful when you use custom tooltips, but no one requested it before, so...

As for the forcing, not sure if it can be implemented better. The only problem I see is that setting tooltip_forced and using it happens in 2 different places. If it somehow happens that tooltip is forced, but then not displayed, the flag will affect some random other tooltip.

KoBeWi avatar Dec 06 '22 12:12 KoBeWi