[gnome-control-center] region: Improved keynav on the input chooser



commit 375bf2363fcfdf0916acb0e3550bb5909de5eb12
Author: Rui Matos <tiagomatos gmail com>
Date:   Thu May 17 00:13:54 2012 +0200

    region: Improved keynav on the input chooser
    
    This makes the dialog return when the user presses Enter on the filter
    entry and prevents the GtkTreeView search popup from being used since
    we already handle searching on that tree view.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=662489

 panels/region/gnome-region-panel-input.c |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)
---
diff --git a/panels/region/gnome-region-panel-input.c b/panels/region/gnome-region-panel-input.c
index 1a7d71f..d8a6815 100644
--- a/panels/region/gnome-region-panel-input.c
+++ b/panels/region/gnome-region-panel-input.c
@@ -432,6 +432,13 @@ row_activated (GtkTreeView       *tree_view,
     gtk_dialog_response (GTK_DIALOG (dialog), GTK_RESPONSE_OK);
 }
 
+static void
+entry_activated (GtkBuilder *builder,
+                 gpointer    data)
+{
+  row_activated (NULL, NULL, NULL, builder);
+}
+
 static gboolean
 filter_func (GtkTreeModel *model,
              GtkTreeIter  *iter,
@@ -506,6 +513,12 @@ input_chooser_new (GtkWindow *main_window)
 
   gtk_tree_view_append_column (GTK_TREE_VIEW (filtered_list),
                                visible_column);
+  /* We handle searching ourselves, thank you. */
+  gtk_tree_view_set_enable_search (GTK_TREE_VIEW (filtered_list), FALSE);
+  gtk_tree_view_set_search_column (GTK_TREE_VIEW (filtered_list), -1);
+
+  g_signal_connect_swapped (G_OBJECT (filter_entry), "activate",
+                            G_CALLBACK (entry_activated), builder);
   g_signal_connect_swapped (G_OBJECT (filter_entry), "notify::text",
                             G_CALLBACK (filter_changed), builder);
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]