[gnome-shell/wip/aggregate-menu: 64/99] popupMenu: Ignore submenus when getting the column widths
- From: Jasper St. Pierre <jstpierre src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell/wip/aggregate-menu: 64/99] popupMenu: Ignore submenus when getting the column widths
- Date: Wed, 12 Jun 2013 20:17:26 +0000 (UTC)
commit ab67a33cc164d6224f89f7c2eb350851c54bb77e
Author: Jasper St. Pierre <jstpierre mecheye net>
Date: Tue Jun 11 18:16:03 2013 -0400
popupMenu: Ignore submenus when getting the column widths
The new designs don't want these to be aligned the same way.
js/ui/popupMenu.js | 10 ++++++++--
1 files changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/js/ui/popupMenu.js b/js/ui/popupMenu.js
index faa2fd9..c949fc9 100644
--- a/js/ui/popupMenu.js
+++ b/js/ui/popupMenu.js
@@ -917,9 +917,12 @@ const PopupMenuBase = new Lang.Class({
let columnWidths = [];
let items = this.box.get_children();
for (let i = 0; i < items.length; i++) {
- if (!items[i].visible &&
- !(items[i]._delegate instanceof PopupSubMenu && items[i-1].visible))
+ if (!items[i].visible)
continue;
+
+ if (items[i]._delegate instanceof PopupSubMenu)
+ continue;
+
if (items[i]._delegate instanceof PopupBaseMenuItem || items[i]._delegate instanceof
PopupMenuBase) {
let [itemMaxSpan, itemColumnWidths] = items[i]._delegate.getColumnWidths();
maxSpan = Math.max(maxSpan, itemMaxSpan);
@@ -935,6 +938,9 @@ const PopupMenuBase = new Lang.Class({
setColumnWidths: function(widths) {
let items = this.box.get_children();
for (let i = 0; i < items.length; i++) {
+ if (items[i]._delegate instanceof PopupSubMenu)
+ continue;
+
if (items[i]._delegate instanceof PopupBaseMenuItem || items[i]._delegate instanceof
PopupMenuBase)
items[i]._delegate.setColumnWidths(widths);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]