[gnome-documents/gnome-3-6] preview: add an F10 accelerator for the gear menu



commit 796103500168bfec710109d3ca2e78dbd371342b
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Mon Nov 5 10:14:44 2012 -0500

    preview: add an F10 accelerator for the gear menu
    
    https://bugzilla.gnome.org/show_bug.cgi?id=687544

 src/application.js |    9 +++++++--
 src/preview.js     |    1 +
 2 files changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/src/application.js b/src/application.js
index dd00a20..13fed51 100644
--- a/src/application.js
+++ b/src/application.js
@@ -122,7 +122,7 @@ const Application = new Lang.Class({
             doc.print(this._mainWindow.window);
     },
 
-    _onActionSearch: function(action) {
+    _onActionToggle: function(action) {
         let state = action.get_state();
         action.change_state(GLib.Variant.new('b', !state.get_boolean()));
     },
@@ -142,6 +142,11 @@ const Application = new Lang.Class({
               create_hook: this._fullscreenCreateHook,
               accel: 'F11',
               window_mode: WindowMode.WindowMode.PREVIEW },
+            { name: 'gear-menu',
+              callback: this._onActionToggle,
+              state: GLib.Variant.new('b', false),
+              accel: 'F10',
+              window_mode: WindowMode.WindowMode.PREVIEW },
             { name: 'view-as',
               callback: this._onActionViewAs,
               create_hook: this._viewAsCreateHook,
@@ -155,7 +160,7 @@ const Application = new Lang.Class({
               callback: this._onActionPrintCurrent,
               window_mode: WindowMode.WindowMode.PREVIEW },
             { name: 'search',
-              callback: this._onActionSearch,
+              callback: this._onActionToggle,
               state: GLib.Variant.new('b', false),
               accel: '<Primary>f' },
             { name: 'find-next', accel: '<Primary>g',
diff --git a/src/preview.js b/src/preview.js
index 2a82daa..691eea5 100644
--- a/src/preview.js
+++ b/src/preview.js
@@ -373,6 +373,7 @@ const PreviewToolbar = new Lang.Class({
         let previewMenu = this._getPreviewMenu();
         let menuButton = this.widget.add_menu('emblem-system-symbolic', null, false);
         menuButton.set_menu_model(previewMenu);
+        menuButton.set_action_name('app.gear-menu');
 
         this._setToolbarTitle();
         this.widget.show_all();



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