diff --git a/CHANGELOG.md b/CHANGELOG.md index 26cd8a9057..37e311ffc5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,8 @@ You can find its changes [documented below](#060---2020-06-01). ### Fixed +- GTK: Directory selection now properly ignores file filters. ([#957] by [@xStrom]) + ### Visual - `TextBox` stroke remains inside its `paint_rect`. ([#1007] by [@jneem]) @@ -295,6 +297,7 @@ Last release without a changelog :( [#951]: https://github.com/xi-editor/druid/pull/951 [#953]: https://github.com/xi-editor/druid/pull/953 [#954]: https://github.com/xi-editor/druid/pull/954 +[#957]: https://github.com/xi-editor/druid/pull/957 [#959]: https://github.com/xi-editor/druid/pull/959 [#961]: https://github.com/xi-editor/druid/pull/961 [#963]: https://github.com/xi-editor/druid/pull/963 diff --git a/druid-shell/src/platform/gtk/dialog.rs b/druid-shell/src/platform/gtk/dialog.rs index cb53b62a0d..2eeed94cb3 100644 --- a/druid-shell/src/platform/gtk/dialog.rs +++ b/druid-shell/src/platform/gtk/dialog.rs @@ -53,7 +53,9 @@ pub(crate) fn get_file_dialog_path( dialog.set_show_hidden(options.show_hidden); - dialog.set_select_multiple(options.multi_selection); + if action != FileChooserAction::Save { + dialog.set_select_multiple(options.multi_selection); + } // Don't set the filters when showing the folder selection dialog, // because then folder traversing won't work. @@ -76,15 +78,9 @@ pub(crate) fn get_file_dialog_path( } } - if let Some(default_file_type) = &options.default_type { - if options.allowed_types.is_some() && !found_default_filter { - // It's ok to set a default file filter without providing a list of - // allowed filters, but it's not ok (or at least, doesn't work in gtk) - // to provide a default filter that isn't in the (present) list - // of allowed filters. - log::warn!("default file type not found in allowed types"); - } else if !found_default_filter { - dialog.set_filter(&file_filter(default_file_type)); + if let Some(dt) = &options.default_type { + if !found_default_filter { + log::warn!("The default type {:?} is not present in allowed types.", dt); } } }