diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2022-07-04 10:10:47 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-04 10:10:47 +0200 |
commit | ba8e7efc2bba979e2d2be046b5d975dbd7846d35 (patch) | |
tree | 2cadf98919cf10db8ced740a0be6f95fa527eebf /scene/gui | |
parent | c32646c1c3abe796927ed7c0a15aca799a19473e (diff) | |
parent | 446f1b70522d86b9afe93b6543028cbab60ffb61 (diff) |
Merge pull request #38298 from ThakeeNathees/file-dialog-autocomplete-fix
Diffstat (limited to 'scene/gui')
-rw-r--r-- | scene/gui/file_dialog.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/scene/gui/file_dialog.cpp b/scene/gui/file_dialog.cpp index 73effa6c4b..6bb4ac9c6f 100644 --- a/scene/gui/file_dialog.cpp +++ b/scene/gui/file_dialog.cpp @@ -480,7 +480,12 @@ void FileDialog::update_file_name() { String filter_str = filters[idx]; String file_str = file->get_text(); String base_name = file_str.get_basename(); - file_str = base_name + "." + filter_str.strip_edges().to_lower(); + Vector<String> filter_substr = filter_str.split(";"); + if (filter_substr.size() >= 2) { + file_str = base_name + "." + filter_substr[0].strip_edges().get_extension().to_lower(); + } else { + file_str = base_name + "." + filter_str.strip_edges().get_extension().to_lower(); + } file->set_text(file_str); } } |