[gnome-shell/wip/fmuellner/notification-redux+sass: 113/141] windowManager: Take over <super>m keybinding to toggle calendar



commit a0394160b2e22937d0d45bb8251735ed52b56cbe
Author: Florian Müllner <fmuellner gnome org>
Date:   Wed Feb 18 02:52:07 2015 +0100

    windowManager: Take over <super>m keybinding to toggle calendar
    
    It's where all the fun is happening nowadays ...

 data/50-gnome-shell-system.xml.in |    2 +-
 js/ui/messageTray.js              |    7 -------
 js/ui/panel.js                    |   13 ++++++++++---
 js/ui/windowManager.js            |   11 +++++++++++
 4 files changed, 22 insertions(+), 11 deletions(-)
---
diff --git a/data/50-gnome-shell-system.xml.in b/data/50-gnome-shell-system.xml.in
index 3e8c6f8..60f456c 100644
--- a/data/50-gnome-shell-system.xml.in
+++ b/data/50-gnome-shell-system.xml.in
@@ -6,7 +6,7 @@
                 package="gnome-shell">
 
        <KeyListEntry name="toggle-message-tray"
-                      _description="Show the message tray"/>
+                      _description="Show the message list"/>
 
        <KeyListEntry name="focus-active-notification"
                       _description="Focus the active notification"/>
diff --git a/js/ui/messageTray.js b/js/ui/messageTray.js
index 012972c..8a85944 100644
--- a/js/ui/messageTray.js
+++ b/js/ui/messageTray.js
@@ -1703,13 +1703,6 @@ const MessageTray = new Lang.Class({
 
         Main.sessionMode.connect('updated', Lang.bind(this, this._sessionUpdated));
 
-        Main.wm.addKeybinding('toggle-message-tray',
-                              new Gio.Settings({ schema_id: SHELL_KEYBINDINGS_SCHEMA }),
-                              Meta.KeyBindingFlags.NONE,
-                              Shell.ActionMode.NORMAL |
-                              Shell.ActionMode.MESSAGE_TRAY |
-                              Shell.ActionMode.OVERVIEW,
-                              Lang.bind(this, this.toggleAndNavigate));
         Main.wm.addKeybinding('focus-active-notification',
                               new Gio.Settings({ schema_id: SHELL_KEYBINDINGS_SCHEMA }),
                               Meta.KeyBindingFlags.NONE,
diff --git a/js/ui/panel.js b/js/ui/panel.js
index df67e2b..6e4fee3 100644
--- a/js/ui/panel.js
+++ b/js/ui/panel.js
@@ -877,9 +877,8 @@ const Panel = new Lang.Class({
         return Clutter.EVENT_STOP;
     },
 
-    toggleAppMenu: function() {
-        let indicator = this.statusArea.appMenu;
-        if (!indicator) // appMenu not supported by current session mode
+    _toggleMenu: function(indicator) {
+        if (!indicator) // menu not supported by current session mode
             return;
 
         let menu = indicator.menu;
@@ -891,6 +890,14 @@ const Panel = new Lang.Class({
             menu.actor.navigate_focus(null, Gtk.DirectionType.TAB_FORWARD, false);
     },
 
+    toggleAppMenu: function() {
+        this._toggleMenu(this.statusArea.appMenu);
+    },
+
+    toggleCalendar: function() {
+        this._toggleMenu(this.statusArea.dateMenu);
+    },
+
     closeCalendar: function() {
         let indicator = this.statusArea.dateMenu;
         if (!indicator) // calendar not supported by current session mode
diff --git a/js/ui/windowManager.js b/js/ui/windowManager.js
index 5e6bdb5..e6487e9 100644
--- a/js/ui/windowManager.js
+++ b/js/ui/windowManager.js
@@ -821,6 +821,13 @@ const WindowManager = new Lang.Class({
                            Shell.ActionMode.TOPBAR_POPUP,
                            Lang.bind(this, this._toggleAppMenu));
 
+        this.addKeybinding('toggle-message-tray',
+                           new Gio.Settings({ schema_id: SHELL_KEYBINDINGS_SCHEMA }),
+                           Meta.KeyBindingFlags.NONE,
+                           Shell.ActionMode.NORMAL |
+                           Shell.ActionMode.TOPBAR_POPUP,
+                           Lang.bind(this, this._toggleCalendar));
+
         global.display.connect('show-resize-popup', Lang.bind(this, this._showResizePopup));
 
         Main.overview.connect('showing', Lang.bind(this, function() {
@@ -1501,6 +1508,10 @@ const WindowManager = new Lang.Class({
         Main.panel.toggleAppMenu();
     },
 
+    _toggleCalendar: function(display, screen, window, event, binding) {
+        Main.panel.toggleCalendar();
+    },
+
     _toggleTweens: function() {
         this._tweensPaused = !this._tweensPaused;
         const OrigTweener = imports.tweener.tweener;


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