mirror of
https://github.com/godotengine/godot.git
synced 2025-12-08 06:09:55 +00:00
Fix Windows native FileDialog filters not showing descriptions
This commit is contained in:
parent
cb7cd815ee
commit
f835707f7a
2 changed files with 12 additions and 11 deletions
|
|
@ -555,7 +555,7 @@ void DisplayServerWindows::_thread_fd_monitor(void *p_ud) {
|
|||
if (!exts.is_empty()) {
|
||||
String str = String(";").join(exts);
|
||||
filter_exts.push_back(str.utf16());
|
||||
if (tokens.size() == 2) {
|
||||
if (tokens.size() >= 2) {
|
||||
filter_names.push_back(tokens[1].strip_edges().utf16());
|
||||
} else {
|
||||
filter_names.push_back(str.utf16());
|
||||
|
|
|
|||
|
|
@ -1162,13 +1162,13 @@ void FileDialog::update_filters() {
|
|||
}
|
||||
|
||||
String native_all_name;
|
||||
if (DisplayServer::get_singleton()->has_feature(DisplayServer::FEATURE_NATIVE_DIALOG_FILE_MIME)) {
|
||||
native_all_name += all_filters;
|
||||
}
|
||||
if (DisplayServer::get_singleton()->has_feature(DisplayServer::FEATURE_NATIVE_DIALOG_FILE_MIME)) {
|
||||
if (!native_all_name.is_empty()) {
|
||||
native_all_name += ", ";
|
||||
}
|
||||
native_all_name += all_mime;
|
||||
}
|
||||
|
||||
if (max_filters < filters.size()) {
|
||||
all_filters += ", ...";
|
||||
|
|
@ -1183,13 +1183,14 @@ void FileDialog::update_filters() {
|
|||
String desc = filters[i].get_slicec(';', 1).strip_edges();
|
||||
String mime = filters[i].get_slicec(';', 2).strip_edges();
|
||||
String native_name;
|
||||
if (DisplayServer::get_singleton()->has_feature(DisplayServer::FEATURE_NATIVE_DIALOG_FILE_MIME)) {
|
||||
|
||||
native_name += flt;
|
||||
}
|
||||
if (DisplayServer::get_singleton()->has_feature(DisplayServer::FEATURE_NATIVE_DIALOG_FILE_MIME)) {
|
||||
if (!native_name.is_empty() && !mime.is_empty()) {
|
||||
native_name += ", ";
|
||||
}
|
||||
native_name += mime;
|
||||
}
|
||||
if (!desc.is_empty()) {
|
||||
filter->add_item(atr(desc) + " (" + flt + ")");
|
||||
processed_filters.push_back(flt + ";" + atr(desc) + " (" + native_name + ");" + mime);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue