From 84e1ed8884192616e2e58a6df35fd8707caa0510 Mon Sep 17 00:00:00 2001 From: arkology <43543909+arkology@users.noreply.github.com> Date: Sun, 16 Mar 2025 14:16:03 +0300 Subject: [PATCH] Fix `ThemeEditor` being too wide for small screen or minimized window --- editor/plugins/theme_editor_plugin.cpp | 3 ++- editor/plugins/theme_editor_preview.cpp | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/editor/plugins/theme_editor_plugin.cpp b/editor/plugins/theme_editor_plugin.cpp index ca0372929da..69a1cde67aa 100644 --- a/editor/plugins/theme_editor_plugin.cpp +++ b/editor/plugins/theme_editor_plugin.cpp @@ -3796,9 +3796,10 @@ ThemeEditor::ThemeEditor() { main_hs->set_v_size_flags(SIZE_EXPAND_FILL); add_child(main_hs); + main_hs->set_split_offset(520 * EDSCALE); + VBoxContainer *preview_tabs_vb = memnew(VBoxContainer); preview_tabs_vb->set_h_size_flags(SIZE_EXPAND_FILL); - preview_tabs_vb->set_custom_minimum_size(Size2(520, 0) * EDSCALE); preview_tabs_vb->add_theme_constant_override("separation", 2 * EDSCALE); main_hs->add_child(preview_tabs_vb); HBoxContainer *preview_tabbar_hb = memnew(HBoxContainer); diff --git a/editor/plugins/theme_editor_preview.cpp b/editor/plugins/theme_editor_preview.cpp index cfeb9992542..021ea8b069f 100644 --- a/editor/plugins/theme_editor_preview.cpp +++ b/editor/plugins/theme_editor_preview.cpp @@ -250,7 +250,7 @@ ThemeEditorPreview::ThemeEditorPreview() { picker_button->connect(SceneStringName(pressed), callable_mp(this, &ThemeEditorPreview::_picker_button_cbk)); MarginContainer *preview_body = memnew(MarginContainer); - preview_body->set_custom_minimum_size(Size2(480, 0) * EDSCALE); + preview_body->set_custom_minimum_size(Size2(200, 0) * EDSCALE); preview_body->set_v_size_flags(SIZE_EXPAND_FILL); add_child(preview_body);