[gnome-shell/wip/flashing-junk: 2/5] popupMenu: Make the section invisible if it has no visible children



commit ef4a611ed4428496b7f03894f2931bb276754a0f
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Mon Aug 26 15:21:45 2013 -0400

    popupMenu: Make the section invisible if it has no visible children

 js/ui/popupMenu.js |   13 +++++++++++--
 1 files changed, 11 insertions(+), 2 deletions(-)
---
diff --git a/js/ui/popupMenu.js b/js/ui/popupMenu.js
index e720c67..1fe78f7 100644
--- a/js/ui/popupMenu.js
+++ b/js/ui/popupMenu.js
@@ -921,10 +921,19 @@ const PopupMenuSection = new Lang.Class({
         this.isOpen = true;
     },
 
+    _syncVisibility: function() {
+        this.actor.visible = !this.isEmpty();
+    },
+
     // deliberately ignore any attempt to open() or close(), but emit the
     // corresponding signal so children can still pick it up
-    open: function() { this.emit('open-state-changed', true); },
-    close: function() { this.emit('open-state-changed', false); },
+    open: function() {
+        this._syncVisibility();
+        this.emit('open-state-changed', true);
+    },
+    close: function() {
+        this.emit('open-state-changed', false);
+    },
 });
 
 const PopupSubMenuMenuItem = new Lang.Class({


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