From 581df9abd59c48aaa7be9debb0b6052711b4c11d Mon Sep 17 00:00:00 2001 From: Nathan Frank Date: Thu, 4 Dec 2025 02:47:23 -0500 Subject: [PATCH 1/9] Add the ability to toggle the dock heights from being individual --- editor/editor_node.cpp | 6 +++++ editor/editor_node.h | 3 +++ editor/gui/editor_bottom_panel.cpp | 35 ++++++++++++++++++++++------- editor/gui/editor_bottom_panel.h | 1 + editor/settings/editor_settings.cpp | 1 + 5 files changed, 38 insertions(+), 8 deletions(-) diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index 6499198e3b21..0a4fdc9248aa 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -1064,6 +1064,7 @@ void EditorNode::_notification(int p_what) { theme->set_constant("dragging_unfold_wait_msec", "Tree", (float)EDITOR_GET("interface/editor/dragging_hover_wait_seconds") * 1000); theme->set_constant("hover_switch_wait_msec", "TabBar", (float)EDITOR_GET("interface/editor/dragging_hover_wait_seconds") * 1000); editor_dock_manager->update_tab_styles(); + bottom_dock_tab_individual_height = EDITOR_GET("interface/editor/bottom_dock_tab_individual_height"); } if (EditorSettings::get_singleton()->check_changed_settings_in_group("interface/scene_tabs")) { @@ -6356,6 +6357,10 @@ bool EditorNode::is_cmdline_mode() { return singleton->cmdline_mode; } +bool EditorNode::is_bottom_dock_tab_individual_height() { + return singleton->bottom_dock_tab_individual_height; +} + void EditorNode::cleanup() { _init_callbacks.clear(); } @@ -9220,6 +9225,7 @@ EditorNode::EditorNode() { } } + follow_system_theme = EDITOR_GET("interface/theme/follow_system_theme"); use_system_accent_color = EDITOR_GET("interface/theme/use_system_accent_color"); } diff --git a/editor/editor_node.h b/editor/editor_node.h index 3db1ec62f77a..ac3e26675b00 100644 --- a/editor/editor_node.h +++ b/editor/editor_node.h @@ -431,6 +431,7 @@ class EditorNode : public Node { Callable palette_file_selected_callback; EditorBottomPanel *bottom_panel = nullptr; + bool bottom_dock_tab_individual_height = false; Tree *disk_changed_list = nullptr; LocalVector disk_changed_scenes; @@ -779,6 +780,8 @@ class EditorNode : public Node { static bool is_cmdline_mode(); + static bool is_bottom_dock_tab_individual_height(); + static HashMap get_initial_settings(); static void cleanup(); diff --git a/editor/gui/editor_bottom_panel.cpp b/editor/gui/editor_bottom_panel.cpp index ebe61c954ba5..3aef0436b36e 100644 --- a/editor/gui/editor_bottom_panel.cpp +++ b/editor/gui/editor_bottom_panel.cpp @@ -79,13 +79,25 @@ void EditorBottomPanel::_theme_changed() { } void EditorBottomPanel::set_bottom_panel_offset(int p_offset) { - EditorDock *current_tab = Object::cast_to(get_current_tab_control()); - if (current_tab) { - dock_offsets[current_tab->get_effective_layout_key()] = p_offset; + if (EditorNode::get_singleton()->is_bottom_dock_tab_individual_height()){ + // Store the individual offsets + EditorDock *current_tab = Object::cast_to(get_current_tab_control()); + if (current_tab) { + dock_offsets[current_tab->get_effective_layout_key()] = p_offset; + } + } else { + // Store the unified offset + dock_offset = p_offset; } } int EditorBottomPanel::get_bottom_panel_offset() { + // Return the unified height + if (!EditorNode::get_singleton()->is_bottom_dock_tab_individual_height()) { + return dock_offset; + } + + // Load the individual tab heights EditorDock *current_tab = Object::cast_to(get_current_tab_control()); if (current_tab) { return dock_offsets[current_tab->get_effective_layout_key()]; @@ -127,14 +139,21 @@ void EditorBottomPanel::save_layout_to_config(Ref p_config_file, con offsets[E.key] = E.value; } p_config_file->set_value(p_section, "bottom_panel_offsets", offsets); + p_config_file->set_value(p_section, "bottom_panel_offset", dock_offset); } void EditorBottomPanel::load_layout_from_config(Ref p_config_file, const String &p_section) { - const Dictionary offsets = p_config_file->get_value(p_section, "bottom_panel_offsets", Dictionary()); - const LocalVector offset_list = offsets.get_key_list(); - - for (const Variant &v : offset_list) { - dock_offsets[v] = offsets[v]; + if (EditorNode::get_singleton()->is_bottom_dock_tab_individual_height()){ + // Load the individual offsets + const Dictionary offsets = p_config_file->get_value(p_section, "bottom_panel_offsets", Dictionary()); + const LocalVector offset_list = offsets.get_key_list(); + for (const Variant &v : offset_list) { + dock_offsets[v] = offsets[v]; + } + } else { + // Load the unified offset + const int offset = p_config_file->get_value(p_section, "bottom_panel_offset", int()); + dock_offset = offset; } _update_center_split_offset(); } diff --git a/editor/gui/editor_bottom_panel.h b/editor/gui/editor_bottom_panel.h index ba9e8bf3618f..bdec768bf841 100644 --- a/editor/gui/editor_bottom_panel.h +++ b/editor/gui/editor_bottom_panel.h @@ -52,6 +52,7 @@ class EditorBottomPanel : public TabContainer { bool lock_panel_switching = false; LocalVector bottom_docks; LocalVector> dock_shortcuts; + int dock_offset; HashMap dock_offsets; LocalVector