godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
91.38k stars 21.26k forks source link

Fix bottom panel sizing with multiple options #99594

Open Giganzo opened 2 days ago

Giganzo commented 2 days ago

Fixes: https://github.com/godotengine/godot/issues/95681

Did see this issue a while ago and thought it looked interesting, as I needed to create something similar in gdscript and if a version could be made for the editor.

I did now see there is PR for this already. Haven't looked how it is implemented or tested it. If not used in its entirety maybe something here can be useful or combined in to a PR.

Features:

I first made a version with < prev and next > buttons. But decided to remove them to save space in the bottom panel, as the popup menu gives you a good overview of all the options.

Before: Screenshot_20241123_085708

After (looks the same): Screenshot_20241123_085542

Compact

Default: Screenshot_20241123_090050

Light: Screenshot_20241123_090116

Oled: Screenshot_20241123_090141

Resizing and scrolling between options:

You can speed up scroll by holding alt key.

Screencast_20241123_091418.webm

Scrolls to clicked option:

Screencast_20241123_091707.webm

Scrolls to popup menu selection:

Popup only shows buttons visible in the bottom panel.

Screencast_20241123_092159.webm

Scrolls to the editor opened by events such as clicking on a node in the tree:

Screencast_20241123_092408.webm

tetrapod00 commented 2 days ago

For testing, I re-uploaded the two extreme MRPs from the issue for convenience:

This PR handles both of them just fine: godot windows editor x86_64_RXN3MlIZaH godot windows editor x86_64_ZLIEwlNIoM

I'm not sure why, but in the Many Small MRP, this PR can't open any of the custom bottom panel tabs besides Test0. I'm not sure if that's a problem with this PR or with the MRP. These MRPs are not necessarily robust implementations of bottom panel plugins; they mostly exist as proof of concept of the problem existing.

https://github.com/user-attachments/assets/1a858a89-3924-468c-b2ea-9a9877005a9a


So the really bad cases seem solved by this (once the issue with Many Small is solved). I also tested casually with a more normal workload using only built-in bottom panels, and it works as expected.

Is it possible to have the popup appear so the base is aligned with the top of the three dot button, rather than covering it? godot windows editor x86_64_ukTKiBNi89

Other three dot buttons spawn their popups directly below the button, they don't cover the button: godot windows editor x86_64_96oBLgxudu godot windows editor x86_64_3v163izSS0

Giganzo commented 1 day ago

Is it possible to have the popup appear so the base is aligned with the top of the three dot button, rather than covering it?

Should open like this now Screenshot_20241124_054116

tetrapod00 commented 1 day ago

The last editor artifact is broken for me on Windows 10:

godot windows editor x86_64_w6dUCWTsD0

Edit: If I spam click on it, it works correctly. This might be an unrelated bug, it seems familiar.

godot windows editor x86_64_qdm8BwasHT

Yep, it's https://github.com/godotengine/godot/issues/99581 or something similar.

Giganzo commented 21 hours ago

The last editor artifact is broken for me on Windows 10: Yep, it's https://github.com/godotengine/godot/issues/99581 or something similar.

This didn't happen before?

Tried another approach with the button. Does this also trigger the above issue?

tetrapod00 commented 20 hours ago

https://github.com/user-attachments/assets/2bae75bf-dd73-48c4-a29a-331ee8c5ff5a

With this one, it's easier to get a correctly spawned popup, but it's still possible to get the bad version of the popup by spamming left click. I really suspect that this problem is unrelated to your PR, and is something similar to https://github.com/godotengine/godot/issues/99581. But I haven't reviewed your actual code and I don't know enough to, all I can do is test the functionality.

Giganzo commented 19 hours ago

Thanks for testing! About the spam clicking, missed a bit of code in your latest test. Added it in now, hopefully it helps.