From 41e9e7070526689f61e23f80be5f78a40bdfd969 Mon Sep 17 00:00:00 2001 From: kobewi Date: Wed, 18 Feb 2026 15:48:19 +0100 Subject: [PATCH] Don't hard-code dock names in default layout --- editor/editor_node.cpp | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index c5cf6e1009..e708f4a5d1 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -9009,9 +9009,22 @@ EditorNode::EditorNode() { const String docks_section = "docks"; default_layout.instantiate(); // Dock numbers are based on DockSlot enum value + 1. - default_layout->set_value(docks_section, "dock_3", "Scene,Import"); - default_layout->set_value(docks_section, "dock_4", "FileSystem,History"); - default_layout->set_value(docks_section, "dock_5", "Inspector,Signals,Groups"); + { + const String scene_key = SceneTreeDock::get_singleton()->get_effective_layout_key(); + const String import_key = ImportDock::get_singleton()->get_effective_layout_key(); + default_layout->set_value(docks_section, "dock_3", vformat("%s,%s", scene_key, import_key)); + } + { + const String filesystem_key = filesystem_dock->get_effective_layout_key(); + const String history_key = history_dock->get_effective_layout_key(); + default_layout->set_value(docks_section, "dock_4", vformat("%s,%s", filesystem_key, history_key)); + } + { + const String inspector_key = InspectorDock::get_singleton()->get_effective_layout_key(); + const String signals_key = SignalsDock::get_singleton()->get_effective_layout_key(); + const String groups_key = GroupsDock::get_singleton()->get_effective_layout_key(); + default_layout->set_value(docks_section, "dock_5", vformat("%s,%s,%s", inspector_key, signals_key, groups_key)); + } int hsplits[] = { 0, dock_hsize, -dock_hsize, 0 }; for (int i = 0; i < (int)std_size(hsplits); i++) {