From 610d98f3ea894e012d7afa0b579019d8babfae02 Mon Sep 17 00:00:00 2001 From: aXu-AP <1621768+aXu-AP@users.noreply.github.com> Date: Thu, 12 Sep 2024 14:51:22 +0300 Subject: [PATCH] Make script list default wider, minimum narrower Give more space to the script lists by default, but makes minimum smaller than it was. Unifies script editor and shader editor to use same values. --- editor/plugins/script_editor_plugin.cpp | 4 ++-- editor/plugins/shader_editor_plugin.cpp | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/editor/plugins/script_editor_plugin.cpp b/editor/plugins/script_editor_plugin.cpp index 253005c5ced..190bfb0ab73 100644 --- a/editor/plugins/script_editor_plugin.cpp +++ b/editor/plugins/script_editor_plugin.cpp @@ -4107,9 +4107,9 @@ ScriptEditor::ScriptEditor(WindowWrapper *p_wrapper) { script_list = memnew(ItemList); script_list->set_auto_translate_mode(AUTO_TRANSLATE_MODE_DISABLED); scripts_vbox->add_child(script_list); - script_list->set_custom_minimum_size(Size2(150, 60) * EDSCALE); //need to give a bit of limit to avoid it from disappearing + script_list->set_custom_minimum_size(Size2(100, 60) * EDSCALE); //need to give a bit of limit to avoid it from disappearing script_list->set_v_size_flags(SIZE_EXPAND_FILL); - script_split->set_split_offset(70 * EDSCALE); + script_split->set_split_offset(200 * EDSCALE); _sort_list_on_update = true; script_list->connect("item_clicked", callable_mp(this, &ScriptEditor::_script_list_clicked), CONNECT_DEFERRED); script_list->set_allow_rmb_select(true); diff --git a/editor/plugins/shader_editor_plugin.cpp b/editor/plugins/shader_editor_plugin.cpp index 597ef490047..e0155d44f52 100644 --- a/editor/plugins/shader_editor_plugin.cpp +++ b/editor/plugins/shader_editor_plugin.cpp @@ -773,6 +773,7 @@ ShaderEditorPlugin::ShaderEditorPlugin() { window_wrapper->set_margins_enabled(true); main_split = memnew(HSplitContainer); + main_split->set_split_offset(200 * EDSCALE); Ref make_floating_shortcut = ED_SHORTCUT_AND_COMMAND("shader_editor/make_floating", TTR("Make Floating")); window_wrapper->set_wrapped_control(main_split, make_floating_shortcut); @@ -818,7 +819,7 @@ ShaderEditorPlugin::ShaderEditorPlugin() { SET_DRAG_FORWARDING_GCD(shader_list, ShaderEditorPlugin); main_split->add_child(left_panel); - left_panel->set_custom_minimum_size(Size2(200, 300) * EDSCALE); + left_panel->set_custom_minimum_size(Size2(100, 300) * EDSCALE); shader_tabs = memnew(TabContainer); shader_tabs->set_tabs_visible(false);