summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2022-11-25 14:05:00 +0100
committerRémi Verschelde <rverschelde@gmail.com>2022-11-25 14:05:00 +0100
commitcfaf2f168f233a7183a65d273085789fc47883ff (patch)
treef2f090c667d53da9add55f2424888bd52a546c1f
parent5b3d07cc0232215bcdc901369862da50a7e89b3b (diff)
parent302ddbcfd9bbfae3ec54f88188438e956df1487e (diff)
Merge pull request #69147 from Sauermann/fix-docks-ordering
Fix that the History Dock appears before other Docks in old projects
-rw-r--r--editor/editor_node.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp
index 7c297a39d0..2f6481704a 100644
--- a/editor/editor_node.cpp
+++ b/editor/editor_node.cpp
@@ -4883,7 +4883,7 @@ void EditorNode::_load_docks_from_config(Ref<ConfigFile> p_layout, const String
Vector<String> names = String(p_layout->get_value(p_section, "dock_" + itos(i + 1))).split(",");
- for (int j = 0; j < names.size(); j++) {
+ for (int j = names.size() - 1; j >= 0; j--) {
String name = names[j];
// FIXME: Find it, in a horribly inefficient way.
int atidx = -1;
@@ -4904,7 +4904,7 @@ void EditorNode::_load_docks_from_config(Ref<ConfigFile> p_layout, const String
}
if (atidx == i) {
- node->move_to_front();
+ dock_slot[i]->move_child(node, 0);
continue;
}
@@ -4914,6 +4914,7 @@ void EditorNode::_load_docks_from_config(Ref<ConfigFile> p_layout, const String
dock_slot[atidx]->hide();
}
dock_slot[i]->add_child(node);
+ dock_slot[i]->move_child(node, 0);
dock_slot[i]->show();
}
}