diff options
author | volzhs <volzhs@gmail.com> | 2017-12-16 22:52:51 +0900 |
---|---|---|
committer | volzhs <volzhs@gmail.com> | 2017-12-16 23:26:43 +0900 |
commit | 15e77b3b60c184fe0a48bacf2e0d232e02a7b64c (patch) | |
tree | b1f3eac06df6d9539a8bad29d15dfc2383535bb4 | |
parent | b07049faeab1add2950a84bee81b2e9b62898482 (diff) |
Enchance FileSystem dock
* Collapse / Uncollapse folder with double click
* Sync with tree and bottom panel
* Show selected folder in tree when changed
-rw-r--r-- | editor/filesystem_dock.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/editor/filesystem_dock.cpp b/editor/filesystem_dock.cpp index 9ece36ea80..a756366edf 100644 --- a/editor/filesystem_dock.cpp +++ b/editor/filesystem_dock.cpp @@ -129,6 +129,7 @@ void FileSystemDock::_update_tree(bool keep_collapse_state) { } _create_tree(root, EditorFileSystem::get_singleton()->get_filesystem(), uncollapsed_paths); + tree->ensure_cursor_is_visible(); updating_tree = false; } @@ -592,8 +593,7 @@ void FileSystemDock::_select_file(int p_idx) { } path = fpath; _update_files(false); - current_path->set_text(path); - _push_to_history(); + navigate_to_path(path); } else { if (ResourceLoader::get_resource_type(fpath) == "PackedScene") { editor->open_request(fpath); @@ -1219,6 +1219,9 @@ void FileSystemDock::_go_to_file_list() { tree->hide(); file_list_vb->show(); button_favorite->hide(); + } else { + bool collapsed = tree->get_selected()->is_collapsed(); + tree->get_selected()->set_collapsed(!collapsed); } //file_options->show(); |