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

gridcontainer hint/tooltip disturb the layout #46976

Open
astrale-sharp opened this issue Mar 13, 2021 · 7 comments
Open

gridcontainer hint/tooltip disturb the layout #46976

astrale-sharp opened this issue Mar 13, 2021 · 7 comments

Comments

@astrale-sharp
Copy link

Godot version:

3.2.3.stable

OS/device including version:

❯ screenfetch
/usr/bin/screenfetch: ligne 2549: gconftool-2 : commande introuvable
                                       astrale@Sharp
 MMMMMMMMMMMMMMMMMMMMMMMMMmds+.        OS: Linuxmint 20.1 ulyssa
 MMm----::-://////////////oymNMd+`     Kernel: x86_64 Linux 5.4.0-66-generic
 MMd      /++                -sNMd:    Uptime: 11h 41m
 MMNso/`  dMM    `.::-. .-::.` .hMN:   Packages: 4211
 ddddMMh  dMM   :hNMNMNhNMNMNh: `NMm   Shell: fish 3.1.0
     NMm  dMM  .NMN/-+MMM+-/NMN` dMM   Resolution: 1920x1080
     NMm  dMM  -MMm  `MMM   dMM. dMM   DE: Cinnamon 4.8.6
     NMm  dMM  -MMm  `MMM   dMM. dMM   WM: Metacity
     NMm  dMM  .mmd  `mmm   yMM. dMM   GTK Theme: Mint-Y-Dark-Red [GTK2/3]
     NMm  dMM`  ..`   ...   ydm. dMM   Icon Theme: Mint-Y-Dark-Red
     hMM- +MMd/-------...-:sdds  dMM   Font: Ubuntu Condensed, 24
     -NMm- :hNMNNNmdddddddddy/`  dMM   Disk: 841G / 1,1T (87%)
      -dMNs-``-::::-------.``    dMM   CPU: Intel Core i3-2330M @ 4x 2.2GHz [74.0°C]
       `/dMNmy+/:-------------:/yMMM   GPU: GeForce GT 630M
          ./ydNMMMMMMMMMMMMMMMMMMMMM   RAM: 2732MiB / 3844MiB
             \.MMMMMMMMMMMMMMMMMMM    
                                      

Issue description:

Hi!
When you're using a GridContainer with some hint you get a jittery result like that :
grid_container

When you're using a HBoxcontainer with some tooltip you get a nice message on top that doesn't disturb the alignment like this:
hbox_container

Steps to reproduce:
add a GridContainer with some tool tip to a scene.

@Calinou
Copy link
Member

Calinou commented Mar 13, 2021

@astrale-sharp Please upload a minimal reproduction project to make this easier to troubleshoot.

@kuhnchris
Copy link

image
image
The issue gets more complicated the more items you add to the grid:
image
I didn't get to explode it like OP did tho. Attached is a project with the issue at hand.
It is, however, affected by the length of the tool tip:
image
(see the button)

me-46976.zip

@kuhnchris
Copy link

On further investigation:

godot/scene/main/viewport.cpp

Lines 1579 to 1587 in 942f5f0

TooltipPanel *panel = memnew(TooltipPanel);
panel->set_transient(false);
panel->set_flag(Window::FLAG_NO_FOCUS, true);
panel->set_wrap_controls(true);
panel->add_child(base_tooltip);
gui.tooltip_popup = panel;
tooltip_owner->add_child(gui.tooltip_popup);

I assume this may be caused due to the TooltipPanel being parented to the GridContainer (and HBoxContainer).
The HBoxContainer _resort() function is very different to the grid_container one, tho I would fail to see where this may cause an issue, but i'm just a godot programmer rookie, so maybe the seniors may know a bit more.
But just by the look of it, wouldn't it make more sense to parent the tooltip to the scene_root instead of the "tooltip owner"? Because I assume that this may be the main issue of this, as the aforementioned parenting happens directly on the node tree (if you investigate via the Remote tab in Godot):
image
(HBoxContainer, works)
image
(GridContainer, explodes)

@KoBeWi
Copy link
Member

KoBeWi commented Mar 14, 2021

This is fixed in 4.0, but the fix can't be backported (because it happened with DisplayServer rewrite).

@astrale-sharp
Copy link
Author

Damn i finished my minimal reproduction project before reading this was fixed ~~
I dont upload then, right?

If this is fixed, i guess we can close the issue

@Calinou
Copy link
Member

Calinou commented Mar 19, 2021

To solve this in 3.x, shouldn't tooltips be added high up in the scene tree?

@KoBeWi
Copy link
Member

KoBeWi commented Mar 19, 2021

Yeah, we could add them directly under viewport. But maybe there was a reason why it wasn't done in the first place.

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

No branches or pull requests

4 participants