GNOME Bugzilla – Bug 707801
Fix issues with submenus and separators hiding/showing when they aren't supposed to
Last modified: 2013-09-17 15:04:36 UTC
The quick hack fix we did to hide rogue separators in the lock screen was incorrect and made some sections show when they weren't supposed to. Revert that and fix the separator visiblity logic.
Created attachment 254516 [details] [review] Revert "popupMenu: Make the section invisible if it has no visible children" This reverts commit 5a0ac6c2ac5686c679988c2ca922ed758d2b19f1.
Created attachment 254517 [details] [review] popupMenu: Fix algorithm for separator visibility to work with sections Before, separators naively checked whether their siblings were visible using actor visibility. However, if section actors are visible but have no visible children, this will fail. Special-case separators when doing visiblity checks.
Review of attachment 254516 [details] [review]: You hadn't reverted this yet?
Review of attachment 254517 [details] [review]: ::: js/ui/popupMenu.js @@ +38,3 @@ +function isPopupMenuItemVisible(child) { + if (child._delegate instanceof PopupMenuSection) + return !child._delegate.isEmpty(); The section can be empty, or can be not empty and invisible. In both cases you need to hide the separator.
Created attachment 254599 [details] [review] popupMenu: Fix algorithm for separator visibility to work with sections Before, separators naively checked whether their siblings were visible using actor visibility. However, if section actors are visible but have no visible children, this will fail. Special-case separators when doing visiblity checks.
Review of attachment 254599 [details] [review]: ::: js/ui/popupMenu.js @@ +38,3 @@ +function isPopupMenuItemVisible(child) { + if (child._delegate instanceof PopupMenuSection) + if (!child._delegate.isEmpty()) Isn't the logic reversed here? I mean, an empty section is like an invisible section, not the other way around.
Created attachment 254601 [details] [review] popupMenu: Fix algorithm for separator visibility to work with sections Before, separators naively checked whether their siblings were visible using actor visibility. However, if section actors are visible but have no visible children, this will fail. Special-case separators when doing visiblity checks. I noticed that in testing, and thought I squashed before reattaching. Guess not.
Review of attachment 254601 [details] [review]: Looks good to me.
Attachment 254516 [details] pushed as fd9401c - Revert "popupMenu: Make the section invisible if it has no visible children" Attachment 254601 [details] pushed as 660f0fe - popupMenu: Fix algorithm for separator visibility to work with sections
*** Bug 708244 has been marked as a duplicate of this bug. ***