popupMenu: Treat a menu will all invisible menu items as empty

As an example, a menu that has only settings actions might
be "empty" if allowSettings is false.

https://bugzilla.gnome.org/show_bug.cgi?id=681540
This commit is contained in:
Jasper St. Pierre 2013-02-14 16:48:28 -05:00
parent 498bc21133
commit 30179bb60d

View File

@ -914,7 +914,11 @@ const PopupMenuBase = new Lang.Class({
}, },
isEmpty: function() { isEmpty: function() {
return this.box.get_n_children() == 0; let hasVisibleChildren = this.box.get_children().some(function(child) {
return child.visible;
});
return !hasVisibleChildren;
}, },
isChildMenu: function(menu) { isChildMenu: function(menu) {