[polari/wip/fmuellner/combined-gsoc: 49/137] app: Add shortcut to toggle search button



commit 1857af1eafeb3805c0137d38915d9cd3633f15f9
Author: Florian Müllner <fmuellner gnome org>
Date:   Fri Jul 22 14:02:21 2016 +0200

    app: Add shortcut to toggle search button

 data/resources/main-window.ui |    1 +
 src/application.js            |    4 ++++
 2 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/data/resources/main-window.ui b/data/resources/main-window.ui
index 6d923e6..a1fbf9c 100644
--- a/data/resources/main-window.ui
+++ b/data/resources/main-window.ui
@@ -54,6 +54,7 @@
                                 <property name="valign">center</property>
                                 <property name="margin-start">5</property>
                                 <property name="margin-end">5</property>
+                                <property name="action-name">app.toggle-search</property>
                                 <property name="active" bind-source="searchBar"
                                           bind-property="search-mode-enabled" 
bind-flags="sync-create|bidirectional"/>
                                 <style>
diff --git a/src/application.js b/src/application.js
index 4d7fea3..026772e 100644
--- a/src/application.js
+++ b/src/application.js
@@ -116,6 +116,10 @@ const Application = new Lang.Class({
             accels: ['<Alt><Shift>Down', '<Primary><Shift>Page_Down']},
           { name: 'previous-pending-room',
             accels: ['<Alt><Shift>Up', '<Primary><Shift>Page_Up']},
+          { name: 'toggle-search',
+            activate: Lang.bind(this, this._onToggleAction),
+            state: GLib.Variant.new('b', false),
+            accels: ['<Primary>f','<Primary>s'] },
           { name: 'search-terms',
             parameter_type: GLib.VariantType.new('s'),
             state: GLib.Variant.new('s', '') },


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