From: Matthias Clasen Date: Mon, 29 Jun 2015 15:39:22 +0000 (-0700) Subject: file chooser: Make search shortcut toggle X-Git-Tag: archive/raspbian/4.4.1+ds1-2+rpi1^2~18^2~24^2~9185 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=5bc88bdc676e85b5ecc022fb486da779f1c068b9;p=gtk4.git file chooser: Make search shortcut toggle This is more in line with having a toggle button for search, and it matches what we do e.g. in nautilus. --- diff --git a/gtk/gtkfilechooserwidget.c b/gtk/gtkfilechooserwidget.c index a497b4ad4d..c944257f6b 100644 --- a/gtk/gtkfilechooserwidget.c +++ b/gtk/gtkfilechooserwidget.c @@ -7295,7 +7295,18 @@ desktop_folder_handler (GtkFileChooserWidget *impl) static void search_shortcut_handler (GtkFileChooserWidget *impl) { - operation_mode_set (impl, OPERATION_MODE_SEARCH); + GtkFileChooserWidgetPrivate *priv = impl->priv; + + if (priv->operation_mode == OPERATION_MODE_SEARCH) + { + operation_mode_set (impl, OPERATION_MODE_BROWSE); + if (priv->current_folder) + change_folder_and_display_error (impl, priv->current_folder, FALSE); + else + switch_to_home_dir (impl); + } + else + operation_mode_set (impl, OPERATION_MODE_SEARCH); } /* Handler for the "recent-shortcut" keybinding signal */