Skip to content
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 Control to show custom tooltip when tooltip text is empty #97961

Merged
merged 1 commit into from
Oct 14, 2024

Conversation

timothyqiu
Copy link
Member

@timothyqiu timothyqiu commented Oct 8, 2024

Fixes #97944
Fixes #97990

In #97397, I changed the implementation of button's shortcut_in_tooltip from overriding get_tooltip() to overriding make_custom_tooltip(). However, if a button only has shortcut and no actual tooltip text, then the viewport assumes that the tooltip is not needed and make_custom_tooltip() is no longer called.

This PR makes the tooltip displayed when the tooltip text is not empty or make_custom_tooltip() returns a valid control.

This is useful when you want to make a customized tooltip without meaningful tooltip text.

@timothyqiu timothyqiu changed the title Allow Control to force show tooltips Allow Control to show custom tooltip when tooltip text is empty Oct 8, 2024
Co-Authored-By: bruvzg <7645683+bruvzg@users.noreply.github.com>
@bruvzg
Copy link
Member

bruvzg commented Oct 8, 2024

Tested with #97944 and #97990, all tooltips seem to be working as expected.

@Repiteo Repiteo merged commit ba9e98f into godotengine:master Oct 14, 2024
19 checks passed
@Repiteo
Copy link
Contributor

Repiteo commented Oct 14, 2024

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants