[gnome-shell/wip/fmuellner/notification-redux: 56/128] panel: Add	closeCalendar() function
- From: Florian Müllner <fmuellner src gnome org>
- To: commits-list gnome org
- Cc: 
- Subject: [gnome-shell/wip/fmuellner/notification-redux: 56/128] panel: Add	closeCalendar() function
- Date: Tue, 17 Feb 2015 11:24:22 +0000 (UTC)
commit fe28b1dcd9cd3b911412e15d4eca782e8150266e
Author: Florian Müllner <fmuellner gnome org>
Date:   Fri Feb 13 10:44:13 2015 +0100
    panel: Add closeCalendar() function
    
    To be used from the calendar/messageList when activating actions,
    and possibly from the messageTray when receiving an urgent notification;
    however the latter doesn't sound like a good idea to me, so I'd rather
    leave that out and see how it goes ...
 js/ui/panel.js |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)
---
diff --git a/js/ui/panel.js b/js/ui/panel.js
index 87930aa..163ffce 100644
--- a/js/ui/panel.js
+++ b/js/ui/panel.js
@@ -1061,6 +1061,18 @@ const Panel = new Lang.Class({
             menu.actor.navigate_focus(null, Gtk.DirectionType.TAB_FORWARD, false);
     },
 
+    closeCalendar: function() {
+        let indicator = this.statusArea.dateMenu;
+        if (!indicator) // calendar not supported by current session mode
+            return;
+
+        let menu = indicator.menu;
+        if (!indicator.actor.reactive)
+            return;
+
+        menu.close();
+    },
+
     set boxOpacity(value) {
         let isReactive = value > 0;
 
[
Date Prev][
Date Next]   [
Thread Prev][
Thread Next]   
[
Thread Index]
[
Date Index]
[
Author Index]