[seahorse/gnome-3-32] KeyManager: Enable type to search



commit 8bf703924c1e2317bd6653658cf2af33d20a7765
Author: Niels De Graef <nielsdegraef gmail com>
Date:   Fri Apr 19 21:51:19 2019 +0200

    KeyManager: Enable type to search
    
    (cherry-picked from commit 4a01a3cdc82678955f70ea40e602f9eb3479be97)
    
    Automatically start searching when the user starts typing, as described
    by the GNOME HIG: https://developer.gnome.org/hig/stable/search.html.en
    
    Fixes https://gitlab.gnome.org/GNOME/seahorse/issues/218

 src/key-manager.vala        | 7 +++++++
 src/seahorse-key-manager.ui | 3 ++-
 src/sidebar.vala            | 1 -
 3 files changed, 9 insertions(+), 2 deletions(-)
---
diff --git a/src/key-manager.vala b/src/key-manager.vala
index 1ec80e83..957f9899 100644
--- a/src/key-manager.vala
+++ b/src/key-manager.vala
@@ -23,6 +23,8 @@
 [GtkTemplate (ui = "/org/gnome/Seahorse/seahorse-key-manager.ui")]
 public class Seahorse.KeyManager : Catalog {
 
+    [GtkChild]
+    private Gtk.SearchBar search_bar;
     [GtkChild]
     private Gtk.SearchEntry filter_entry;
 
@@ -442,4 +444,9 @@ public class Seahorse.KeyManager : Catalog {
             }
         });
     }
+
+    [GtkCallback]
+    private bool on_key_pressed(Gtk.Widget widget, Gdk.EventKey event) {
+        return this.search_bar.handle_event(event);
+    }
 }
diff --git a/src/seahorse-key-manager.ui b/src/seahorse-key-manager.ui
index 37724b3d..063a78e8 100644
--- a/src/seahorse-key-manager.ui
+++ b/src/seahorse-key-manager.ui
@@ -269,6 +269,7 @@
     <property name="default-width">600</property>
     <property name="default-height">476</property>
     <signal name="drag-data-received" handler="on_drag_data_received" />
+    <signal name="key-press-event" handler="on_key_pressed"/>
     <child type="titlebar">
       <object class="GtkHeaderBar">
         <property name="visible">True</property>
@@ -349,7 +350,7 @@
             <property name="visible">True</property>
             <property name="orientation">vertical</property>
             <child>
-              <object class="GtkSearchBar">
+              <object class="GtkSearchBar" id="search_bar">
                 <property name="visible">True</property>
                 <property name="search-mode-enabled" bind-source="show_search_button" bind-property="active" 
bind-flags="bidirectional|sync-create" />
                 <property name="can_focus">False</property>
diff --git a/src/sidebar.vala b/src/sidebar.vala
index b9255e1d..f7a0b2f9 100644
--- a/src/sidebar.vala
+++ b/src/sidebar.vala
@@ -162,7 +162,6 @@ public class Seahorse.Sidebar : Gtk.TreeView {
 
         set_headers_visible(false);
         set_tooltip_column(Column.TOOLTIP);
-        set_search_column(Column.LABEL);
         set_model(this.store);
         this.popup_menu.connect(on_popup_menu);
         this.button_press_event.connect(on_button_press_event);


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