[gnome-characters] window: Toggle search with Ctrl+F



commit 03aa193b7676c6180f72711e5d49461a1622ec9f
Author: Daiki Ueno <dueno src gnome org>
Date:   Sat Jul 1 18:03:44 2017 +0200

    window: Toggle search with Ctrl+F
    
    Suggested by Adrien Plazas in:
    https://bugzilla.gnome.org/show_bug.cgi?id=783859

 src/window.js |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/src/window.js b/src/window.js
index 05d0ee2..dd018df 100644
--- a/src/window.js
+++ b/src/window.js
@@ -69,6 +69,8 @@ const MainWindow = new Lang.Class({
                             activate: this._toggleSearch,
                             parameter_type: new GLib.VariantType('b'),
                             state: new GLib.Variant('b', false) },
+                          { name: 'find',
+                            activate: this._find },
                           { name: 'category',
                             activate: this._category,
                             parameter_type: new GLib.VariantType('s'),
@@ -80,6 +82,8 @@ const MainWindow = new Lang.Class({
                             activate: this._filterFont,
                             parameter_type: new GLib.VariantType('s') }]);
 
+        this.application.set_accels_for_action('win.find', ['<Primary>F']);
+
         this.bind_property('search-active', this._search_active_button, 'active',
                            GObject.BindingFlags.SYNC_CREATE |
                            GObject.BindingFlags.BIDIRECTIONAL);
@@ -217,6 +221,10 @@ const MainWindow = new Lang.Class({
         this._menu_popover.hide();
     },
 
+    _find: function() {
+        this.search_active = !this.search_active;
+    },
+
     setSearchKeywords: function(keywords) {
         this.search_active = keywords.length > 0;
         this._search_entry.set_text(keywords.join(' '));


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