-
-
Notifications
You must be signed in to change notification settings - Fork 22.9k
Fix EditorTitleBar excessive width #109396
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
base: master
Are you sure you want to change the base?
Conversation
2801488
to
1fc93ee
Compare
For the main screen buttons, I was wondering if we shouldn't change them to TabBar/TabContainer, which would eventually allow to use main screen as a dock slot. Related: #106164 |
For main screen buttons (2D, 3D, ect.) this is 100% improvement (existing buttons will not break layout at editor minimum size and buttons added by plugins will not make it worse). |
I already have an old change that allows reparenting the ![]() I already have some changes locally that can reduce their width and was thinking about reusing the new EditorScrollBar container introduced in this PR to move the select buttons to the left of the 2D/3D Editors like how they are done in Blender, I remember i have seen a feature request asking for that too. ![]() |
![]() |
<param index="0" name="control" type="Control" /> | ||
<description> | ||
Ensures the given [param control] is visible. | ||
[b]Note:[/b] This will not work on a node that was just added during the same frame. If you want to scroll to a newly added child, you must wait until the next frame using [signal SceneTree.process_frame]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have made a change to the method to defer the call internally, but i forgot to update the docs. It should work fine without this Note.
void EditorScrollBox::ensure_control_visible(Control *p_control) {
ERR_FAIL_NULL(p_control);
if (scroll_container->is_ancestor_of(p_control)) {
callable_mp(scroll_container, &ScrollContainer::ensure_control_visible).call_deferred(p_control);
}
}
Some notes: There's Window title can be added to the menu scroll container, since only one of two can be visible at the same time (menu bar still need to be in the scene tree, but will be zero size and invisible). Window drag can be fixed by setting PASS mouse filter on all new containers. |
1fc93ee
to
692cbdd
Compare
I have applied a fix, please test again to confirm it.
I have applied a fix, some containers was using mouse filter
This is a result of reducing the editor size to 640x480, happens on all platforms because the main screen and bottom panels plugins still doesn't support the new size efficiently.
I gave the main screen buttons a higher stretch ratio on MACOS since there's no longer a menu. please check with EditorDebugger plugin for the best stretch ratio that fits MACOS. |
We may not need this anymore after this PR since it doesn't require the old ways of centering the main screen buttons and it's managed automatically by only using 3 containers and their expanding methods, the MainScreenButtons now have the higher expand ratio and is still affected by the EditorRunBar and the Renderer Button which are all part of the right hbox now. |
It's not always 3 controls, there are extra spacers (left/right_menu_spacer) added on macOS to account for window buttons, these spacers are always different width, so this will introduce misalignment. I'll retest it tomorrow. |
I guess these extra spacers can be replaced by extra margins on side containers, these only exist to reserve empty space, actual window buttons are native elements and controlled/drawn by OS. |
Removed the right spacer since it's useless now after this change and moved the left spacer into the left HBox container is an internal child since it's only used for MACOS to show the title label, so they are now only 3 children for the EditorTitleBar. Note: we also can add the label directly to the left hbox and we remove the left spacer too. The new EditorScrollBox can't work with spacers since it doesn't have a minimum size and it needs to expand to fill the available space to be functional. Also for testing i have used Zylan.EditorDebugger plugin to hide the CIE and the game editor top HFlowContainer because they was preventing resizing down the window. |
692cbdd
to
5a795c6
Compare
Screencast.From.2025-08-07.20-20-24.mp4
Summary of Changes:
Pause and Stop Buttons Hidden (Not Disabled):
EditorScrollBox Extracted for Reuse:
BottomPanel
excessive width. #97878) has been extracted into its own class to allow reuse across the editor. This helps address excessive width/height issues and enables its use in EditorPlugin UIs.Improved Layout in EditorTitleBar:
[ left_hb ] [ center_hb ] [ right_hb ]
New Minimum Editor Size:
Selective Use of EditorScrollBox:
Note: it’s currently difficult to keep the main screen buttons centered when many plugins are added to the right container.
Requires testing on Android Editor to confirm compatibility and layout integrity on smaller screens.