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



commit 4098480b81243746431b5a83e26f82102f125f8d
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]