~pete-woods/unity8/fix-unity-platform-ispc-lp1670657

« back to all changes in this revision

Viewing changes to qml/ApplicationMenus/MenuBar.qml

Fix real world submenus (e.g. kate) not getting their first item selected on open

MenuBar.qml: remove unused function
MenuPopup.qml: Select first item when one arrives if there's no currentItem instead of on completion
unitymenumodel.cpp: trick rowCount() to simulate "real world late" menus
tst_MenuPopup.qml: adapt to unitymenumodel.cpp changes (and make the Up test actually press Up and not Down) (LP: #1666859)

Approved by: Lukáš Tinkl, Unity8 CI Bot

Show diffs side-by-side

added added

removed removed

Lines of Context:
44
44
    implicitWidth: row.width
45
45
    height: parent.height
46
46
 
47
 
    function select(index) {
48
 
        d.select(index);
49
 
    }
50
 
 
51
47
    function dismiss() {
52
48
        d.dismissAll();
53
49
    }
142
138
                                                                 objectName: visualItem.objectName + "-menu",
143
139
                                                                 desiredX: Qt.binding(function() { return visualItem.x - units.gu(1); }),
144
140
                                                                 desiredY: Qt.binding(function() { return root.height; }),
145
 
                                                                 unityMenuModel: Qt.binding(function() { return root.unityMenuModel.submenu(visualItem.__ownIndex); })
 
141
                                                                 unityMenuModel: Qt.binding(function() { return root.unityMenuModel.submenu(visualItem.__ownIndex); }),
 
142
                                                                 selectFirstOnCountChange: false
146
143
                                                             });
147
144
                        __popup.reset();
148
145
                        __popup.childActivated.connect(dismiss);