summaryrefslogtreecommitdiff
path: root/editor
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2019-05-11 09:49:34 +0200
committerGitHub <noreply@github.com>2019-05-11 09:49:34 +0200
commit89c37dae490b8072a0997bbcab739c45ecb3044d (patch)
treeb246a275177821fc4b742e1d39b114ef581e1784 /editor
parent58c5eb781eed33da16890e310f06c317c5aca619 (diff)
parentfedf9cd3796dabdadb2faf362eaadeb4fded22af (diff)
Merge pull request #28807 from bojidar-bg/28798-open-filesystem
Open selected folder when pressing the "Open" option in the menu
Diffstat (limited to 'editor')
-rw-r--r--editor/filesystem_dock.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/editor/filesystem_dock.cpp b/editor/filesystem_dock.cpp
index 97ff516055..9e214935f1 100644
--- a/editor/filesystem_dock.cpp
+++ b/editor/filesystem_dock.cpp
@@ -1490,6 +1490,15 @@ void FileSystemDock::_file_option(int p_option, const Vector<String> p_selected)
} break;
case FILE_OPEN: {
+ // Open folders
+ TreeItem *selected = tree->get_root();
+ selected = tree->get_next_selected(selected);
+ while (selected) {
+ if (p_selected.find(selected->get_metadata(0)) >= 0) {
+ selected->set_collapsed(false);
+ }
+ selected = tree->get_next_selected(selected);
+ }
// Open the file
for (int i = 0; i < p_selected.size(); i++) {
_select_file(p_selected[i]);