[gnome-shell] popupMenu: Treat a menu will all invisible menu items as empty
- From: Jasper St. Pierre <jstpierre src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell] popupMenu: Treat a menu will all invisible menu items as empty
- Date: Thu, 14 Feb 2013 23:16:35 +0000 (UTC)
commit 30179bb60d9788faa04a2fb9703f15429da9727d
Author: Jasper St. Pierre <jstpierre mecheye net>
Date: Thu Feb 14 16:48:28 2013 -0500
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
js/ui/popupMenu.js | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/js/ui/popupMenu.js b/js/ui/popupMenu.js
index 9807b62..5123696 100644
--- a/js/ui/popupMenu.js
+++ b/js/ui/popupMenu.js
@@ -914,7 +914,11 @@ const PopupMenuBase = new Lang.Class({
},
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) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]