[gnome-shell/wip/aggregate-menu: 36/75] popupMenu: Ensure that submenus are properly hidden when insensitive



commit 02e6f444c0925f629f9e8f7dc2b24b5272c41fcd
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Wed Jun 12 03:35:28 2013 -0400

    popupMenu: Ensure that submenus are properly hidden when insensitive
    
    We don't actually propagate sensitivity information to submenus; we
    simply make sure that they can never be open when the parent is
    insensitive.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=702539

 js/ui/popupMenu.js |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/js/ui/popupMenu.js b/js/ui/popupMenu.js
index 8d15aea..0ffc754 100644
--- a/js/ui/popupMenu.js
+++ b/js/ui/popupMenu.js
@@ -1383,6 +1383,13 @@ const PopupSubMenuMenuItem = new Lang.Class({
         this.menu.connect('open-state-changed', Lang.bind(this, this._subMenuOpenStateChanged));
     },
 
+    syncSensitive: function() {
+        let sensitive = this.parent();
+        this._triangle.visible = sensitive;
+        if (!sensitive)
+            this.menu.close(false);
+    },
+
     _subMenuOpenStateChanged: function(menu, open) {
         if (open)
             this.actor.add_style_pseudo_class('open');


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