diff options
author | Matthias Clasen <mclasen@redhat.com> | 2015-01-28 16:06:02 -0500 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2015-01-28 16:07:51 -0500 |
commit | 86eefc7609cfb5428f40309b3deb22ef1cf4cde1 (patch) | |
tree | 8d8378abca6f1351cbd50c8d509fa6dc44d1cd8d | |
parent | 1d64175c4b0a83ca7e9535c5dbf4e6ba1e8dfda1 (diff) | |
download | gtk+-86eefc7609cfb5428f40309b3deb22ef1cf4cde1.tar.gz |
file chooser: Make Escape go out of search mode
This works in most other places where we have search,
and is the expected behavior.
-rw-r--r-- | gtk/gtkfilechooserwidget.c | 8 | ||||
-rw-r--r-- | gtk/ui/gtkfilechooserwidget.ui | 1 |
2 files changed, 9 insertions, 0 deletions
diff --git a/gtk/gtkfilechooserwidget.c b/gtk/gtkfilechooserwidget.c index 9434081975..bc9224ef47 100644 --- a/gtk/gtkfilechooserwidget.c +++ b/gtk/gtkfilechooserwidget.c @@ -527,6 +527,7 @@ static void search_clear_model (GtkFileChooserWidget *impl, static gboolean search_should_respond (GtkFileChooserWidget *impl); static GSList *search_get_selected_files (GtkFileChooserWidget *impl); static void search_entry_activate_cb (GtkFileChooserWidget *impl); +static void search_entry_stop_cb (GtkFileChooserWidget *impl); static void settings_load (GtkFileChooserWidget *impl); static void show_filters (GtkFileChooserWidget *impl, @@ -6257,6 +6258,12 @@ search_entry_activate_cb (GtkFileChooserWidget *impl) search_start_query (impl, text); } +static void +search_entry_stop_cb (GtkFileChooserWidget *impl) +{ + operation_mode_set (impl, OPERATION_MODE_BROWSE); +} + /* Hides the path bar and creates the search entry */ static void search_setup_widgets (GtkFileChooserWidget *impl) @@ -7425,6 +7432,7 @@ gtk_file_chooser_widget_class_init (GtkFileChooserWidgetClass *class) gtk_widget_class_bind_template_callback (widget_class, places_sidebar_show_error_message_cb); gtk_widget_class_bind_template_callback (widget_class, places_sidebar_show_enter_location_cb); gtk_widget_class_bind_template_callback (widget_class, search_entry_activate_cb); + gtk_widget_class_bind_template_callback (widget_class, search_entry_stop_cb); } static void diff --git a/gtk/ui/gtkfilechooserwidget.ui b/gtk/ui/gtkfilechooserwidget.ui index d04346b209..a2617d90e3 100644 --- a/gtk/ui/gtkfilechooserwidget.ui +++ b/gtk/ui/gtkfilechooserwidget.ui @@ -131,6 +131,7 @@ <property name="visible">True</property> <property name="hexpand">True</property> <signal name="search-changed" handler="search_entry_activate_cb" swapped="yes"/> + <signal name="stop-search" handler="search_entry_stop_cb" swapped="yes"/> </object> </child> </object> |