浏览代码

Uncollapse favorites by default in the editor FileSystem dock

Hugo Locurcio 2 年之前
父节点
当前提交
075bd4b281
共有 1 个文件被更改,包括 6 次插入1 次删除
  1. 6 1
      editor/editor_node.cpp

+ 6 - 1
editor/editor_node.cpp

@@ -5007,12 +5007,17 @@ void EditorNode::_load_editor_layout() {
 	config.instantiate();
 	Error err = config->load(EditorPaths::get_singleton()->get_project_settings_dir().path_join("editor_layout.cfg"));
 	if (err != OK) { // No config.
-		// If config is not found, expand the res:// folder by default.
+		// If config is not found, expand the res:// folder and favorites by default.
 		TreeItem *root = FileSystemDock::get_singleton()->get_tree_control()->get_item_with_metadata("res://", 0);
 		if (root) {
 			root->set_collapsed(false);
 		}
 
+		TreeItem *favorites = FileSystemDock::get_singleton()->get_tree_control()->get_item_with_metadata("Favorites", 0);
+		if (favorites) {
+			favorites->set_collapsed(false);
+		}
+
 		if (overridden_default_layout >= 0) {
 			_layout_menu_option(overridden_default_layout);
 		}