[gnome-shell/wip/fmuellner/notification-redux+sass: 99/141] panel: Add	function to close the calendar
- From: Florian Müllner <fmuellner src gnome org>
 
- To: commits-list gnome org
 
- Cc: 
 
- Subject: [gnome-shell/wip/fmuellner/notification-redux+sass: 99/141] panel: Add	function to close the calendar
 
- Date: Thu, 19 Feb 2015 21:03:10 +0000 (UTC)
 
commit c11c8b2107f3765c1c984c026c11d51620d6af14
Author: Florian Müllner <fmuellner gnome org>
Date:   Fri Feb 13 10:44:13 2015 +0100
    panel: Add function to close the calendar
    
    We will soon replace regular menu items in the calendar drop-down
    with more complex elements.
    However there will still be items that should close the drop down
    when activated - rather than making the menu available throughout
    the hierarchy (and eventually from outside as well when we add the
    notifications list), have a public method on a global object just
    like the ubiquitous Main.overview.hide().
    
    https://bugzilla.gnome.org/show_bug.cgi?id=744817
 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 eadf399..df67e2b 100644
--- a/js/ui/panel.js
+++ b/js/ui/panel.js
@@ -891,6 +891,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]