popupMenu: Ignore submenus when getting the column widths
The new designs don't want these to be aligned the same way. https://bugzilla.gnome.org/show_bug.cgi?id=702539
This commit is contained in:
parent
2fa40555e6
commit
ef1eabf033
@ -890,9 +890,12 @@ const PopupMenuBase = new Lang.Class({
|
|||||||
let columnWidths = [];
|
let columnWidths = [];
|
||||||
let items = this.box.get_children();
|
let items = this.box.get_children();
|
||||||
for (let i = 0; i < items.length; i++) {
|
for (let i = 0; i < items.length; i++) {
|
||||||
if (!items[i].visible &&
|
if (!items[i].visible)
|
||||||
!(items[i]._delegate instanceof PopupSubMenu && items[i-1].visible))
|
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
if (items[i]._delegate instanceof PopupSubMenu)
|
||||||
|
continue;
|
||||||
|
|
||||||
if (items[i]._delegate instanceof PopupBaseMenuItem || items[i]._delegate instanceof PopupMenuBase) {
|
if (items[i]._delegate instanceof PopupBaseMenuItem || items[i]._delegate instanceof PopupMenuBase) {
|
||||||
let itemColumnWidths = items[i]._delegate.getColumnWidths();
|
let itemColumnWidths = items[i]._delegate.getColumnWidths();
|
||||||
for (let j = 0; j < itemColumnWidths.length; j++) {
|
for (let j = 0; j < itemColumnWidths.length; j++) {
|
||||||
@ -907,6 +910,9 @@ const PopupMenuBase = new Lang.Class({
|
|||||||
setColumnWidths: function(widths) {
|
setColumnWidths: function(widths) {
|
||||||
let items = this.box.get_children();
|
let items = this.box.get_children();
|
||||||
for (let i = 0; i < items.length; i++) {
|
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)
|
if (items[i]._delegate instanceof PopupBaseMenuItem || items[i]._delegate instanceof PopupMenuBase)
|
||||||
items[i]._delegate.setColumnWidths(widths);
|
items[i]._delegate.setColumnWidths(widths);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user