Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make bottom panel switch when pinned and removed #99096

Merged
merged 1 commit into from
Dec 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion editor/editor_dock_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
6 changes: 3 additions & 3 deletions editor/gui/editor_bottom_panel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -209,16 +209,16 @@ 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.
last_opened_control = items[0].control;
}
}

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) {
Expand Down
2 changes: 1 addition & 1 deletion editor/gui/editor_bottom_panel.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ class EditorBottomPanel : public PanelContainer {

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 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();
Expand Down