diff options
author | Dawid Marzec <marzecdawid@gmail.com> | 2022-11-13 02:24:17 +0100 |
---|---|---|
committer | Dawid Marzec <marzecdawid@gmail.com> | 2022-11-13 02:24:17 +0100 |
commit | 5cd30be56d1d34d84bd423fb99f8fa03edbfe75e (patch) | |
tree | 317e7f0841cf7d3508cd64834ec33d9368bd4daf /scene | |
parent | 140f0395470975f1c20648ffd8807be113a9e373 (diff) |
Remove auto selecting the first file for FileDialog with Save file mode selected
Diffstat (limited to 'scene')
-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); + } } } |