filechooser: Small fix for select folder mode

When changing folders, we were making the select
button insensitive when there is no folder selected.
However, the select button should be usable to
select the current folder.

Fixes #4020
This commit is contained in:
Sophie Herold 2022-04-19 00:55:05 +02:00
parent 0a23c4678f
commit 1e561035e2

View File

@ -2193,7 +2193,9 @@ update_default (GtkFileChooserWidget *impl)
return;
files = gtk_file_chooser_get_files (GTK_FILE_CHOOSER (impl));
sensitive = (g_list_model_get_n_items (files) > 0 || impl->action == GTK_FILE_CHOOSER_ACTION_SAVE);
sensitive = (g_list_model_get_n_items (files) > 0 ||
impl->action == GTK_FILE_CHOOSER_ACTION_SAVE ||
impl->action == GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER);
gtk_widget_set_sensitive (button, sensitive);
g_object_unref (files);