From 32a5b5b5581d916faaf9fd9d1d8a27bdb0364887 Mon Sep 17 00:00:00 2001 From: kit Date: Mon, 11 Nov 2024 18:08:54 -0500 Subject: [PATCH] Make bottom panel switch when pinned and removed --- editor/editor_dock_manager.cpp | 2 +- editor/gui/editor_bottom_panel.cpp | 6 +++--- editor/gui/editor_bottom_panel.h | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/editor/editor_dock_manager.cpp b/editor/editor_dock_manager.cpp index 1db073ec81c..19cbd6aac1e 100644 --- a/editor/editor_dock_manager.cpp +++ b/editor/editor_dock_manager.cpp @@ -712,7 +712,7 @@ void EditorDockManager::focus_dock(Control *p_dock) { } if (all_docks[p_dock].at_bottom) { - EditorNode::get_bottom_panel()->make_item_visible(p_dock); + EditorNode::get_bottom_panel()->make_item_visible(p_dock, true, true); return; } diff --git a/editor/gui/editor_bottom_panel.cpp b/editor/gui/editor_bottom_panel.cpp index 3cc1e37be06..fe966ede5a2 100644 --- a/editor/gui/editor_bottom_panel.cpp +++ b/editor/gui/editor_bottom_panel.cpp @@ -209,7 +209,7 @@ void EditorBottomPanel::remove_item(Control *p_item) { if (was_visible) { // Open the first panel to ensure that if the removed dock was visible, the bottom // panel will not collapse. - _switch_to_item(true, 0); + _switch_to_item(true, 0, true); } else if (last_opened_control == p_item) { // When a dock is removed by plugins, it might not have been visible, and it // might have been the last_opened_control. We need to make sure to reset the last opened control. @@ -217,8 +217,8 @@ void EditorBottomPanel::remove_item(Control *p_item) { } } -void EditorBottomPanel::make_item_visible(Control *p_item, bool p_visible) { - _switch_by_control(p_visible, p_item); +void EditorBottomPanel::make_item_visible(Control *p_item, bool p_visible, bool p_ignore_lock) { + _switch_by_control(p_visible, p_item, p_ignore_lock); } void EditorBottomPanel::move_item_to_end(Control *p_item) { diff --git a/editor/gui/editor_bottom_panel.h b/editor/gui/editor_bottom_panel.h index 950f0e2570b..e94aa941a62 100644 --- a/editor/gui/editor_bottom_panel.h +++ b/editor/gui/editor_bottom_panel.h @@ -75,7 +75,7 @@ public: Button *add_item(String p_text, Control *p_item, const Ref &p_shortcut = nullptr, bool p_at_front = false); void remove_item(Control *p_item); - void make_item_visible(Control *p_item, bool p_visible = true); + void make_item_visible(Control *p_item, bool p_visible = true, bool p_ignore_lock = false); void move_item_to_end(Control *p_item); void hide_bottom_panel(); void toggle_last_opened_bottom_panel();