[gnome-documents] preview: add an F10 accelerator for the gear menu
- From: Cosimo Cecchi <cosimoc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-documents] preview: add an F10 accelerator for the gear menu
- Date: Mon, 5 Nov 2012 15:15:39 +0000 (UTC)
commit 29489b7a3c4b1b2b02d4f17e5750ba7e2f5e8197
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 4759d9f..d2f2e95 100644
--- a/src/application.js
+++ b/src/application.js
@@ -125,7 +125,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()));
},
@@ -145,6 +145,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,
@@ -158,7 +163,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]