Editor: Fix remove_control_from_dock
fails when dock is floating.
This commit is contained in:
parent
30f2a6d611
commit
acf0d395c8
1 changed files with 8 additions and 0 deletions
|
@ -5850,6 +5850,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]) {
|
||||
|
|
Loading…
Reference in a new issue