1
0
mirror of https://github.com/godotengine/godot.git synced 2025-12-01 16:38:31 +00:00

Merge pull request #99096 from kitbdev/bottom_panel_force_switch

Make bottom panel switch when pinned and removed
This commit is contained in:
Thaddeus Crews
2024-12-30 08:58:55 -06:00
3 changed files with 5 additions and 5 deletions

View File

@@ -717,7 +717,7 @@ void EditorDockManager::focus_dock(Control *p_dock) {
} }
if (all_docks[p_dock].at_bottom) { 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; return;
} }

View File

@@ -209,7 +209,7 @@ void EditorBottomPanel::remove_item(Control *p_item) {
if (was_visible) { if (was_visible) {
// Open the first panel to ensure that if the removed dock was visible, the bottom // Open the first panel to ensure that if the removed dock was visible, the bottom
// panel will not collapse. // panel will not collapse.
_switch_to_item(true, 0); _switch_to_item(true, 0, true);
} else if (last_opened_control == p_item) { } else if (last_opened_control == p_item) {
// When a dock is removed by plugins, it might not have been visible, and it // 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. // 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) { void EditorBottomPanel::make_item_visible(Control *p_item, bool p_visible, bool p_ignore_lock) {
_switch_by_control(p_visible, p_item); _switch_by_control(p_visible, p_item, p_ignore_lock);
} }
void EditorBottomPanel::move_item_to_end(Control *p_item) { void EditorBottomPanel::move_item_to_end(Control *p_item) {

View File

@@ -75,7 +75,7 @@ public:
Button *add_item(String p_text, Control *p_item, const Ref<Shortcut> &p_shortcut = nullptr, bool p_at_front = false); Button *add_item(String p_text, Control *p_item, const Ref<Shortcut> &p_shortcut = nullptr, bool p_at_front = false);
void remove_item(Control *p_item); 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 move_item_to_end(Control *p_item);
void hide_bottom_panel(); void hide_bottom_panel();
void toggle_last_opened_bottom_panel(); void toggle_last_opened_bottom_panel();