summaryrefslogtreecommitdiff
path: root/scene/gui
diff options
context:
space:
mode:
authorDawid Marzec <marzecdawid@gmail.com>2022-11-13 02:24:17 +0100
committerDawid Marzec <marzecdawid@gmail.com>2022-11-13 02:24:17 +0100
commit5cd30be56d1d34d84bd423fb99f8fa03edbfe75e (patch)
tree317e7f0841cf7d3508cd64834ec33d9368bd4daf /scene/gui
parent140f0395470975f1c20648ffd8807be113a9e373 (diff)
Remove auto selecting the first file for FileDialog with Save file mode selected
Diffstat (limited to 'scene/gui')
-rw-r--r--scene/gui/file_dialog.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/scene/gui/file_dialog.cpp b/scene/gui/file_dialog.cpp
index cade65108c..11a3803b35 100644
--- a/scene/gui/file_dialog.cpp
+++ b/scene/gui/file_dialog.cpp
@@ -632,8 +632,11 @@ void FileDialog::update_file_list() {
files.pop_front();
}
- if (tree->get_root() && tree->get_root()->get_first_child() && tree->get_selected() == nullptr) {
- tree->get_root()->get_first_child()->select(0);
+ if (mode != FILE_MODE_SAVE_FILE) {
+ // Select the first file from list if nothing is selected.
+ if (tree->get_root() && tree->get_root()->get_first_child() && tree->get_selected() == nullptr) {
+ tree->get_root()->get_first_child()->select(0);
+ }
}
}