[seahorse/wip/nielsdg/ctrl-f] Let <Ctrl>F start the search bar



commit 2794c6d9c156ae44e9108eeb0ef9d9addefa1b0f
Author: Niels De Graef <nielsdegraef gmail com>
Date:   Tue Jan 8 23:20:04 2019 +0100

    Let <Ctrl>F start the search bar
    
    Although we do "search on type", <control>f is still a paradigm that is
    fixed in the mindset of everyone.

 src/application.vala | 1 +
 src/key-manager.vala | 7 +++++++
 2 files changed, 8 insertions(+)
---
diff --git a/src/application.vala b/src/application.vala
index 53ac7fda..9bf44702 100644
--- a/src/application.vala
+++ b/src/application.vala
@@ -85,6 +85,7 @@ public class Seahorse.Application : Gtk.Application {
         set_accels_for_action ("app.help",        {"F1"});
         set_accels_for_action ("app.quit",        {"<control>Q"});
 
+        set_accels_for_action ("win.show-search", { "<control>F" });
         set_accels_for_action ("win.new-item",    { "<control>N" });
         set_accels_for_action ("win.import-file", { "<control>I" });
         set_accels_for_action ("win.copy",        { "<control>C" });
diff --git a/src/key-manager.vala b/src/key-manager.vala
index 56a3d66a..080cde6c 100644
--- a/src/key-manager.vala
+++ b/src/key-manager.vala
@@ -34,6 +34,8 @@ public class Seahorse.KeyManager : Catalog {
 
     [GtkChild]
     private Gtk.MenuButton new_item_button;
+    [GtkChild]
+    private Gtk.ToggleButton show_search_button;
 
     [GtkChild]
     private Gtk.TreeView key_list;
@@ -49,6 +51,7 @@ public class Seahorse.KeyManager : Catalog {
 
     private const GLib.ActionEntry[] action_entries = {
          { "new-item",           on_new_item                                                     },
+         { "show-search",        on_show_search,                                                      },
          { "filter-items",       on_filter_items,              "s",                      "'any'" },
          { "focus-place",        on_focus_place,               "s",           "'secret-service'" },
          { "import-file",        on_import_file                                                  },
@@ -332,6 +335,10 @@ public class Seahorse.KeyManager : Catalog {
         this.store.refilter();
     }
 
+    private void on_show_search(SimpleAction action, Variant? param) {
+        this.show_search_button.active = true;
+    }
+
     private void on_filter_items(SimpleAction action, Variant? param) {
         update_view_filter (param.get_string());
     }


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