on xenial help sign in
only submenus select first, not first level menus
e8793efAlbert Astals Cid
qml/ApplicationMenus/MenuBar.qml+1
@@ -164,6 +164,7 @@ Item {
164 desiredX: visualItem.x - units.gu(1)
164 desiredX: visualItem.x - units.gu(1)
165 desiredY: parent.height
165 desiredY: parent.height
166 unityMenuModel: root.unityMenuModel.submenu(visualItem.__ownIndex)
166 unityMenuModel: root.unityMenuModel.submenu(visualItem.__ownIndex)
167+ selectFirstOnCountChange: false
167
168
168 Component.onCompleted: reset();
169 Component.onCompleted: reset();
169 }
170 }
qml/ApplicationMenus/MenuPopup.qml+3−1
@@ -33,6 +33,8 @@ UbuntuShape {
33 // if they don't fit when growing right
33 // if they don't fit when growing right
34 property bool substractWidth: false
34 property bool substractWidth: false
35
35
36+ property bool selectFirstOnCountChange: true
37+
36 property real desiredX
38 property real desiredX
37 x: {
39 x: {
38 var dummy = visible; // force recalc when shown/hidden
40 var dummy = visible; // force recalc when shown/hidden
@@ -286,7 +288,7 @@ UbuntuShape {
286 id: repeater
288 id: repeater
287
289
288 onCountChanged: {
290 onCountChanged: {
289− if (!d.currentItem && count > 0) {
291+ if (root.selectFirstOnCountChange && !d.currentItem && count > 0) {
290 root.selectFirstIndex();
292 root.selectFirstIndex();
291 }
293 }
292 }
294 }
tests/qmltests/ApplicationMenus/tst_MenuBar.qml+1
@@ -280,6 +280,7 @@ Item {
280 // waits for item to be created so the keyclick actually works
280 // waits for item to be created so the keyclick actually works
281 findChild(menuBar, "menuBar-item0-menu-item1-actionItem");
281 findChild(menuBar, "menuBar-item0-menu-item1-actionItem");
282
282
283+ keyClick(Qt.Key_Down);
283 keyClick(Qt.Key_Down);
284 keyClick(Qt.Key_Down);
284 keyClick(Qt.Key_Right);
285 keyClick(Qt.Key_Right);
285
286