diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2022-11-17 13:48:33 +0100 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2022-11-17 13:48:33 +0100 |
commit | 725f25487c9108829dbf048ee38c654ad424b791 (patch) | |
tree | f7b90ef3af74491617556755a2dfd9455713580a | |
parent | e1ead0fbd111baac21640f9651f680b181e042b6 (diff) | |
parent | 5cd30be56d1d34d84bd423fb99f8fa03edbfe75e (diff) |
Merge pull request #68589 from marzecdawid/remove-default-file-save-filedialog
Remove auto selecting the first file for FileDialog with Save mode
-rw-r--r-- | scene/gui/file_dialog.cpp | 7 |
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); + } } } |