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

Script name tooltips are oversized #77787

Closed
KoBeWi opened this issue Jun 2, 2023 · 1 comment · Fixed by #78009
Closed

Script name tooltips are oversized #77787

KoBeWi opened this issue Jun 2, 2023 · 1 comment · Fixed by #78009

Comments

@KoBeWi
Copy link
Member

KoBeWi commented Jun 2, 2023

Godot version

4.1 db5113d

System information

Windows 10.0.19045 - Vulkan (Forward+) - dedicated NVIDIA GeForce GTX 1060 (NVIDIA; 30.0.15.1403) - Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz (8 Threads)

Issue description

image
Notice the empty space to the right. I actually have a worse case in my project, but I couldn't reproduce it outside:

Regression from #77651
CC @Rindbee

Steps to reproduce

  1. Add a new script
  2. Name it ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;.gd
  3. Hover its name in the Script Editor

Minimal reproduction project

N/A

@Rindbee
Copy link
Contributor

Rindbee commented Jun 7, 2023

The first call to _update_minimum_size() usually happens when the control is first visible in the tree. This might be a bit late for Label. The (minimum) size cache needs to be recalculated after the text is modified and the theme is changed.

Rect2 r(gui.tooltip_pos + tooltip_offset, gui.tooltip_popup->get_contents_minimum_size());

gui.tooltip_popup->set_size(r.size);

And the calculation needs to be done before set_size() is called.

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

Successfully merging a pull request may close this issue.

2 participants