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
This commit is contained in:
Jasper St. Pierre 2013-06-12 03:35:28 -04:00
parent 86835db8f2
commit 4b889eac32

View File

@ -1340,6 +1340,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');