Expand project root directory on editor start
close #16232 Option for expanding all directories on start up is a bit tricky and buggy.
This commit is contained in:
parent
f12e8568d4
commit
127d1241bd
|
@ -77,7 +77,7 @@ bool FileSystemDock::_create_tree(TreeItem *p_parent, EditorFileSystemDirectory
|
|||
return true;
|
||||
}
|
||||
|
||||
void FileSystemDock::_update_tree(bool keep_collapse_state) {
|
||||
void FileSystemDock::_update_tree(bool keep_collapse_state, bool p_uncollapse_root) {
|
||||
|
||||
Vector<String> uncollapsed_paths;
|
||||
if (keep_collapse_state) {
|
||||
|
@ -129,6 +129,10 @@ void FileSystemDock::_update_tree(bool keep_collapse_state) {
|
|||
ti->set_metadata(0, fave);
|
||||
}
|
||||
|
||||
if (p_uncollapse_root) {
|
||||
uncollapsed_paths.push_back("res://");
|
||||
}
|
||||
|
||||
_create_tree(root, EditorFileSystem::get_singleton()->get_filesystem(), uncollapsed_paths);
|
||||
tree->ensure_cursor_is_visible();
|
||||
updating_tree = false;
|
||||
|
@ -204,7 +208,7 @@ void FileSystemDock::_notification(int p_what) {
|
|||
if (EditorFileSystem::get_singleton()->is_scanning()) {
|
||||
_set_scanning_mode();
|
||||
} else {
|
||||
_update_tree(false);
|
||||
_update_tree(false, true);
|
||||
}
|
||||
|
||||
} break;
|
||||
|
|
|
@ -157,7 +157,7 @@ private:
|
|||
bool import_dock_needs_update;
|
||||
|
||||
bool _create_tree(TreeItem *p_parent, EditorFileSystemDirectory *p_dir, Vector<String> &uncollapsed_paths);
|
||||
void _update_tree(bool keep_collapse_state);
|
||||
void _update_tree(bool keep_collapse_state, bool p_uncollapse_root = false);
|
||||
|
||||
void _update_files(bool p_keep_selection);
|
||||
void _update_file_display_toggle_button();
|
||||
|
|
Loading…
Reference in New Issue