X Tutup
Skip to content

Minimize some editor panels to prevent GUI overflow#102301

Draft
arkology wants to merge 1 commit intogodotengine:masterfrom
arkology:mimimizer
Draft

Minimize some editor panels to prevent GUI overflow#102301
arkology wants to merge 1 commit intogodotengine:masterfrom
arkology:mimimizer

Conversation

@arkology
Copy link
Contributor

@arkology arkology commented Feb 1, 2025

Alternative to #101828.
Same as linked PR, may fix #26835 and fix #96479.

Aslo includes #102024 for now

I looked at (almost) every panel which could affect horizontal or vertical overflow when window size is minimal and did some tweaks of minimal size or another changes to minimize panel size (for example, use FlowContainer instead of BoxContainer, enable ScrollContainer scrolling).

For now only missing editor panel is AnimationTree (WIP). But I may overlooked another panels.

Also includes some concomitant changes like enabling Label word wrapping and fixing C++ C26819 warning (this could be reverted if not wanted).

May include some improper changes, so any suggestions are very appreciated. Also, it may look different than it does on my end, and therefore not fix the overflow, so it needs testing.

It could be split into several PRs if needed and changes are accepted.

Before After
AnimationPlayer tab (vertical overflow) image image
Audio tab (vertical overflow) image image
AnimationTree tab (vertical overflow, WIP) image image
Animation, BlendSpace1D (vertical overflow) image image
Animation, BlendSpace2D (horizontal and vertical overflow, WIP) image image
Polygon2DEditor (horizontal and vertical overflow) image image
Shader Editor (vertical overflow) image image
ShaderFile (vertical overflow) image image
SpriteFrames (vertical overflow) image image
ThemeEditor (horizontal and vertical overflow) image image
EditorNetworkProfiler (vertical overflow) image image

bus_scroll->set_v_size_flags(SIZE_EXPAND_FILL);
bus_scroll->set_vertical_scroll_mode(ScrollContainer::SCROLL_MODE_DISABLED);
bus_scroll->set_custom_minimum_size(Size2(0, 200) * EDSCALE);
bus_scroll->set_size(Size2(0, 350) * EDSCALE);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think set_size() has any effect here.
image
Minimizing the editor panels should not affect editor at full size. We need a better sizing mechanism before doing such changes.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I have an idea about it. I will try it and then write the results here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@KoBeWi, I made this #109915. I think in theory it can be used in all other editors too.

@KoBeWi
Copy link
Member

KoBeWi commented Feb 2, 2025

This makes some editors too small by default (as noted above). Unfortunately we don't have "preferred size" and things usually shrink to minimum size. Trying to set default size won't have effect. I encountered the same problem while trying to resolve #26392 (by making minimum size smaller, with default being the same as now) and there is just no solution right now.

@arkology
Copy link
Contributor Author

arkology commented Feb 3, 2025

Thanks for review!
So, at the moment, the only way this pull request can help is to identify some of the places that cause the GUI overflow bug. I think I have an idea about how minimum_size could be changed without breaking current behaviour, but not sure it will work.

Some findings (for Tilemap/TileSet editors, for example) may be still valid and I will move them to another PR.
@KoBeWi what do you think, are current changes OK for Polygon2DEditor, TileMapLayerEditorTilesPlugin, TileSetEditor, EditorNetworkProfiler?

@KoBeWi
Copy link
Member

KoBeWi commented Feb 3, 2025

In Network Profiler the Up label should be together with the following field.
image
Other than that these look good.

Copy link
Member

@Calinou Calinou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested locally (rebased on top of master b607110), it works as expected.

However, there's the issue that the Audio bottom panel now looks like this when you first open it, regardless of the window height:

image

We should try to use a "suggested" height on a best-effort basis where you can see the whole thing, and only see a smaller height if we physically can't fit it within the editor window without overflowing.

I'm not sure if the concept of default/suggested height should be present at a (Split)Container level, or just specific to the editor. Many non-game applications made with Godot run into similar issues in my experience, so they end up having to add some bespoke code for it.

This is the smallest possible height without a visible scroll bar:

image

(Sometimes, I wonder if we could redesign the Audio bottom panel to use an horizontal layout, but this would come with its own caveats when working with a lot of buses.)

@WhalesState
Copy link
Contributor

WhalesState commented Aug 6, 2025

However, there's the issue that the Audio bottom panel now looks like this when you first open it, regardless of the window height:

image

How about queue disabling/enabling vertical scroll when the Audio bottom panel becomes visible/hidden ? will try to see if this can fix the issue.

Edit: This may not work unless we find a way to reset the DockVSplitCenter split_offset too.

@arkology
Copy link
Contributor Author

arkology commented Feb 21, 2026

image

Note for Godot team members: No need to review this PR, I split it into individual PRs linked above (not everything is done at the moment, but most of the work has already been done.)
UPD: Converted PR to draft. Will close it once all its parts will be separated into individual PRs and merged.

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

Projects

None yet

4 participants

X Tutup