[polari/wip/fmuellner/emoji-picker: 3/3] app: Add keybinding to show emoji picker



commit c00963a0c9f6cd2c26178b2224290803ea3d8eb5
Author: Florian Müllner <fmuellner gnome org>
Date:   Wed Aug 9 20:47:13 2017 +0200

    app: Add keybinding to show emoji picker
    
    In order to make the newly added emoji picker more accessible, add
    a new keybinding for popping it up (if available).
    
    https://bugzilla.gnome.org/show_bug.cgi?id=755579

 data/resources/help-overlay.ui |    7 +++++++
 src/application.js             |    2 ++
 src/entryArea.js               |    4 ++++
 3 files changed, 13 insertions(+), 0 deletions(-)
---
diff --git a/data/resources/help-overlay.ui b/data/resources/help-overlay.ui
index 0416747..8437a1a 100644
--- a/data/resources/help-overlay.ui
+++ b/data/resources/help-overlay.ui
@@ -38,6 +38,13 @@
             <child>
               <object class="GtkShortcutsShortcut">
                 <property name="visible">True</property>
+                <property name="title" translatable="yes" context="shortcut window">Show Emoji 
Picker</property>
+                <property name="accelerator">&lt;Primary&gt;e</property>
+              </object>
+            </child>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="visible">True</property>
                 <property name="title" translatable="yes" context="shortcut window">Quit</property>
                 <property name="accelerator">&lt;Primary&gt;q</property>
               </object>
diff --git a/src/application.js b/src/application.js
index c1ce3ca..9053509 100644
--- a/src/application.js
+++ b/src/application.js
@@ -186,6 +186,8 @@ var Application = new Lang.Class({
             parameter_type: GLib.VariantType.new('o') },
           { name: 'discard-identify-password',
             parameter_type: GLib.VariantType.new('o') },
+          { name: 'show-emoji-picker',
+            accels: ['<Primary>e'] },
           { name: 'start-client',
             activate: Lang.bind(this, this._onStartClient) },
           { name: 'help',
diff --git a/src/entryArea.js b/src/entryArea.js
index c4feea0..0bfd0da 100644
--- a/src/entryArea.js
+++ b/src/entryArea.js
@@ -41,6 +41,10 @@ var ChatEntry = new Lang.Class({
 
         this.connect('icon-press', Lang.bind(this, this._showEmojiPicker));
 
+        let app = Gio.Application.get_default();
+        let action = app.lookup_action('show-emoji-picker');
+        action.connect('activate', Lang.bind(this, this._showEmojiPicker));
+
         if (!_checker)
             _checker = new Gspell.Checker();
 


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