Skip to content

Commit

Permalink
Merge pull request #83512 from zaevi/fix_remove_from_floating_dock
Browse files Browse the repository at this point in the history
Editor: Fix `remove_control_from_dock` fails when dock is floating.
  • Loading branch information
akien-mga committed Oct 20, 2023
2 parents db493ed + acf0d39 commit 15955e5
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions editor/editor_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5856,6 +5856,14 @@ void EditorNode::add_control_to_dock(DockSlot p_slot, Control *p_control) {
}

void EditorNode::remove_control_from_dock(Control *p_control) {
// If the dock is floating, close it first.
for (WindowWrapper *wrapper : floating_docks) {
if (p_control == wrapper->get_wrapped_control()) {
wrapper->set_window_enabled(false);
break;
}
}

Control *dock = nullptr;
for (int i = 0; i < DOCK_SLOT_MAX; i++) {
if (p_control->get_parent() == dock_slot[i]) {
Expand Down

0 comments on commit 15955e5

Please sign in to comment.