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.
This commit is contained in:
Matthias Clasen 2015-06-29 08:39:22 -07:00
parent 75411efa48
commit 5bc88bdc67

View File

@ -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 */