summaryrefslogtreecommitdiff
path: root/gtk/gtktreeview.c
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2014-03-13 01:43:27 +0100
committerBenjamin Otte <otte@redhat.com>2014-03-13 02:02:50 +0100
commitc82f2169e5963b63659f1b3fbf3a559dfcbb3baf (patch)
tree98e44cc06e2bceb7a7d6497021ff5a59a9e380e4 /gtk/gtktreeview.c
parent66fae0330c5cdb68f50699ff2645ff0cf112911e (diff)
downloadgtk+-c82f2169e5963b63659f1b3fbf3a559dfcbb3baf.tar.gz
treeview: Split out a function
This is in preparation for the next patch.
Diffstat (limited to 'gtk/gtktreeview.c')
-rw-r--r--gtk/gtktreeview.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/gtk/gtktreeview.c b/gtk/gtktreeview.c
index e4e127fc2e..2776ceab2d 100644
--- a/gtk/gtktreeview.c
+++ b/gtk/gtktreeview.c
@@ -5770,6 +5770,15 @@ gtk_tree_view_get_drop_column (GtkTreeView *tree_view,
}
static gboolean
+gtk_tree_view_search_key_cancels_search (guint keyval)
+{
+ return keyval == GDK_KEY_Escape
+ || keyval == GDK_KEY_Tab
+ || keyval == GDK_KEY_KP_Tab
+ || keyval == GDK_KEY_ISO_Left_Tab;
+}
+
+static gboolean
gtk_tree_view_key_press (GtkWidget *widget,
GdkEventKey *event)
{
@@ -15200,10 +15209,7 @@ gtk_tree_view_search_key_press_event (GtkWidget *widget,
/* close window and cancel the search */
if (!tree_view->priv->search_custom_entry_set
- && (event->keyval == GDK_KEY_Escape ||
- event->keyval == GDK_KEY_Tab ||
- event->keyval == GDK_KEY_KP_Tab ||
- event->keyval == GDK_KEY_ISO_Left_Tab))
+ && gtk_tree_view_search_key_cancels_search (event->keyval))
{
gtk_tree_view_search_dialog_hide (widget, tree_view,
gdk_event_get_device ((GdkEvent *) event));