From 7950c4afddbdd47b24744725ebb31b00e0b66cdf Mon Sep 17 00:00:00 2001 From: Debarshi Ray Date: Sat, 14 Jul 2012 13:07:24 +0200 Subject: [PATCH] messageTray: Add a toggle-message-tray keybinding to toggle the tray The default value is m. https://bugzilla.gnome.org/show_bug.cgi?id=681392 --- data/org.gnome.shell.gschema.xml.in.in | 7 +++++++ js/ui/messageTray.js | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/data/org.gnome.shell.gschema.xml.in.in b/data/org.gnome.shell.gschema.xml.in.in index ac4a1e31d..866732f08 100644 --- a/data/org.gnome.shell.gschema.xml.in.in +++ b/data/org.gnome.shell.gschema.xml.in.in @@ -87,6 +87,13 @@ value here is from the GsmPresenceStatus enumeration. Keybinding to open the application menu. + + ["<Super>m"] + <_summary>Keybinding to toggle the visibility of the message tray + <_description> + Keybinding to toggle the visibility of the message tray. + + r']]]> <_summary>Keybinding to toggle the screen recorder diff --git a/js/ui/messageTray.js b/js/ui/messageTray.js index 3c6a216aa..c71d7f64e 100644 --- a/js/ui/messageTray.js +++ b/js/ui/messageTray.js @@ -21,6 +21,8 @@ const Params = imports.misc.params; const Tweener = imports.ui.tweener; const Util = imports.misc.util; +const SHELL_KEYBINDINGS_SCHEMA = 'org.gnome.shell.keybindings'; + const ANIMATION_TIME = 0.2; const NOTIFICATION_TIMEOUT = 4; const SUMMARY_TIMEOUT = 1; @@ -1592,6 +1594,11 @@ const MessageTray = new Lang.Class({ this._isScreenLocked = false; Main.screenShield.connect('lock-status-changed', Lang.bind(this, this._onScreenLockStatusChanged)); + global.display.add_keybinding('toggle-message-tray', + new Gio.Settings({ schema: SHELL_KEYBINDINGS_SCHEMA }), + Meta.KeyBindingFlags.NONE, + Lang.bind(this, this.toggle)); + this._summaryItems = []; // We keep a list of new summary items that were added to the summary since the last // time it was shown to the user. We automatically show the summary to the user if there