Fix EditorTitleBar excessive width - #109396
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.
|
|
|
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
It's not useless, if OS language is right-to-left and Godot language is left-to-right (or vice versa) buttons will be over the right spacer. |
|
Dragging seems to work. Title still not visible. And main tabs still off center, it does not matter if there are a same number of controls on the both sides as long as spacers are different fixed size it will be off: |
It's so hard to access a mac and it will be great if you can help me by downloading EditorDebugger from asset store then enabling inspecting elements in the plugin and you inspect the title bar with F12 to be able to change the label or container settings in editor inspector to find a quick fix. The reason why they are not centered is that they are no longer 3 containers, it should be like this to work on mac similar to other platforms. Also for RTL layout i tested it and it works fine in all other platforms. |
ab8f084 to
402ed20
Compare
| Button *button = get_left_button(); | ||
| button->set_button_icon(theme_cache.arrow_left); | ||
| button->set_accessibility_name(TTRC("Scroll Left")); | ||
| button->set_tooltip_text(TTRC("Scroll Left\nHold Ctrl to scroll to the begin.\nHold Shift to scroll one page.")); |
There was a problem hiding this comment.
On RTL layout it says scroll to the begin instead of end, and to fix this it will result in 4 translated lines instead of just 2, so we can consider replacing both translations to say Hold Ctrl to scroll to the far left and Hold Ctrl to scroll to the far right.
402ed20 to
2226350
Compare
2226350 to
f339fb5
Compare
…op bar. Co-authored-by: Pāvels Nadtočajevs <7645683+bruvzg@users.noreply.github.com> Co-authored-by: A Thousand Ships <96648715+AThousandShips@users.noreply.github.com> Co-authored-by: Tomasz Chabora <kobewi4e@gmail.com>
f339fb5 to
c4cb22f
Compare
|
Needs rebase |
| #endif | ||
| } else { | ||
| #ifndef MACOS_ENABLED | ||
| menu_scroll_box = memnew(EditorScrollBox); |
There was a problem hiding this comment.
I think putting the menu buttons into a Scroll Box is a weird UX, I haven't seen menu buttons be scrollable like this.
It is also inconsistent, since to save space it can already be collapsed to a main menu button with an Editor Setting, there doesn't need to be 2 different ways to allow it to be smaller.
Ideally we would just switch to the collapsed main menu when there isn't enough space.
However I think it would need custom code to detect when it is too small (or something like godotengine/godot-proposals#12397), so this can be changed later in a future PR.
There was a problem hiding this comment.
Main screen plugins might eventually get converted to docks, so the top buttons would become a TabBar.
|
This hasn't been rebased in a month, so this should probably be salvaged by another contributor. |
|
#113051 would effectively replace it if it's merged (like what happened with bottom panel xd). |
Sorry for the delay. I can rebase the PR and resolve the conflicts if needed. But TBH, I actually prefer the dock-able main screens approach over this PR. This change was mainly a workaround to reduce the editor window width, but several other editor plugins would still require proper adjustments to fully support smaller layouts. So in the long term, the dock-able solution feels cleaner since it doesn't require a new temporary editor class.
To avoid unnecessary conflicts, it might be better to focus on testing and resolving the Android crash in #113051 instead. |
Review is now stale
|
Superseded by #113051; thanks for your contribution! |


Screencast.From.2025-08-07.20-20-24.mp4
Summary of Changes:
EditorScrollBox Extracted for Reuse:
BottomPanelexcessive width. #97878) has been extracted into its own class to allow reuse across the editor. This helps address excessive width issues.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.
Note: The change to the Renderer Button shown in the demo video is not included in this PR. That change is part of Use renderer icons instead of text to reduce the topbar width. #109357, and is shown in the video only to demonstrate the final result when both PRs are merged.
Note: The Pause and Stop button changes shown in the video have been removed from this PR. They will be moved to a separate PR if needed.