on xenial help sign in
We want to select the first enabled, not necessarily 0
b0910f7Albert Astals Cid
qml/ApplicationMenus/MenuPopup.qml+4−4
@@ -73,8 +73,8 @@ UbuntuShape {
73 d.currentItem = null;
73 d.currentItem = null;
74 }
74 }
75
75
76− function select(index) {
76+ function selectFirstIndex() {
77− d.select(index)
77+ d.selectNext(-1);
78 }
78 }
79
79
80 function reset() {
80 function reset() {
@@ -287,7 +287,7 @@ UbuntuShape {
287
287
288 onCountChanged: {
288 onCountChanged: {
289 if (!d.currentItem && count > 0) {
289 if (!d.currentItem && count > 0) {
290− root.select(0);
290+ root.selectFirstIndex();
291 }
291 }
292 }
292 }
293
293
@@ -489,7 +489,7 @@ UbuntuShape {
489 onChildActivated: childActivated();
489 onChildActivated: childActivated();
490 }
490 }
491
491
492− onVisibleChanged: if (visible) { item.select(0); }
492+ onVisibleChanged: if (visible) { item.selectFirstIndex(); }
493 }
493 }
494 }
494 }
495 }
495 }