summaryrefslogtreecommitdiff
path: root/editor/filesystem_dock.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'editor/filesystem_dock.cpp')
-rw-r--r--editor/filesystem_dock.cpp18
1 files changed, 8 insertions, 10 deletions
diff --git a/editor/filesystem_dock.cpp b/editor/filesystem_dock.cpp
index 9ece36ea80..75e4f39e25 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;
}
@@ -146,7 +147,7 @@ void FileSystemDock::_notification(int p_what) {
if (low_height_mode) {
- file_list_vb->hide();
+ tree->hide();
tree->set_v_size_flags(SIZE_EXPAND_FILL);
button_tree->show();
} else {
@@ -157,6 +158,7 @@ void FileSystemDock::_notification(int p_what) {
button_favorite->show();
_update_tree(true);
}
+ tree->ensure_cursor_is_visible();
if (!file_list_vb->is_visible()) {
file_list_vb->show();
@@ -344,11 +346,7 @@ void FileSystemDock::navigate_to_path(const String &p_path) {
_update_tree(true);
_update_files(false);
} else {
- if (file_name.empty()) {
- _go_to_tree();
- } else {
- _go_to_file_list();
- }
+ _go_to_file_list();
}
if (!file_name.empty()) {
@@ -590,10 +588,7 @@ void FileSystemDock::_select_file(int p_idx) {
if (fpath != "res://") {
fpath = fpath.substr(0, fpath.length() - 1);
}
- path = fpath;
- _update_files(false);
- current_path->set_text(path);
- _push_to_history();
+ navigate_to_path(fpath);
} else {
if (ResourceLoader::get_resource_type(fpath) == "PackedScene") {
editor->open_request(fpath);
@@ -1219,6 +1214,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();