Verified Commit 05c69880 authored by Iain Lane's avatar Iain Lane

fr-window: Use GtkSearchEntry::stop-search instead of handling manually

This is a bit of technical debt cleanup. We don't need to handle
cancelling the search entry at the low level key handler layer any more.

Requires GTK 3.16.
parent 982944ac
......@@ -5,7 +5,7 @@ project('file-roller', 'c',
)
glib_version = '>=2.36'
gtk_version = '>=3.13.2'
gtk_version = '>=3.16.0'
nautilus_version = '>=2.22.2'
json_glib_version = '>=0.14.0'
libnotify_version = '>=0.4.3'
......
......@@ -4817,17 +4817,8 @@ key_press_cb (GtkWidget *widget,
if (gtk_widget_has_focus (window->priv->location_entry))
return GDK_EVENT_PROPAGATE;
if (gtk_widget_has_focus (window->priv->filter_entry)) {
switch (event->keyval) {
case GDK_KEY_Escape:
fr_window_deactivate_filter (window);
retval = GDK_EVENT_STOP;
break;
default:
break;
}
return retval;
}
if (gtk_widget_has_focus (window->priv->filter_entry))
return GDK_EVENT_PROPAGATE;
alt = (event->state & GDK_MOD1_MASK) == GDK_MOD1_MASK;
......@@ -5435,6 +5426,12 @@ filter_entry_search_changed_cb (GtkEntry *entry,
fr_window_activate_filter (window);
}
static void
filter_entry_stop_search_cb (GtkSearchEntry *entry,
FrWindow *window)
{
fr_window_deactivate_filter (window);
}
static void
fr_window_attach (FrWindow *window,
......@@ -5720,6 +5717,10 @@ fr_window_construct (FrWindow *window)
"search-changed",
G_CALLBACK (filter_entry_search_changed_cb),
window);
g_signal_connect (G_OBJECT (window->priv->filter_entry),
"stop-search",
G_CALLBACK (filter_entry_stop_search_cb),
window);
gtk_search_bar_connect_entry (GTK_SEARCH_BAR (window->priv->filter_bar), GTK_ENTRY (window->priv->filter_entry));
gtk_container_add (GTK_CONTAINER (window->priv->filter_bar), filter_box);
gtk_box_pack_start (GTK_BOX (filter_box), window->priv->filter_entry, TRUE, TRUE, 0);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment