Merge lp:~aacid/unity8/disabledMenus into lp:unity8

Proposed by Albert Astals Cid
Status: Merged
Approved by: Lukáš Tinkl
Approved revision: 2852
Merged at revision: 2887
Proposed branch: lp:~aacid/unity8/disabledMenus
Merge into: lp:unity8
Prerequisite: lp:~aacid/unity8/aboutToShow
Diff against target: 221 lines (+102/-11)
8 files modified
qml/Panel/MenuContent.qml (+2/-2)
qml/Panel/Panel.qml (+1/-0)
qml/Panel/PanelBar.qml (+16/-0)
qml/Panel/PanelItemRow.qml (+32/-6)
qml/Panel/PanelMenu.qml (+2/-2)
qml/Panel/PanelMenuPage.qml (+1/-1)
tests/qmltests/ApplicationMenus/tst_MenuBar.qml (+24/-0)
tests/qmltests/Panel/tst_Panel.qml (+24/-0)
To merge this branch: bzr merge lp:~aacid/unity8/disabledMenus
Reviewer Review Type Date Requested Status
Unity8 CI Bot continuous-integration Approve
Lukáš Tinkl (community) Approve
Review via email: mp+319288@code.launchpad.net

Commit message

Support Panel top level items to be disabled

I needed to change the way MenuContent changes its position
from using the highlight to simply setting the contentX directly
since otherwise in some reset cases the position was wrong

Description of the change

Prereq-archive: ppa:ci-train-ppa-service/2548

Silo available at https://bileto.ubuntu.com/#/ticket/2548

* Are there any related MPs required for this MP to build/function as expected?
https://code.launchpad.net/~aacid/qmenumodel/disabledMenus/+merge/319286
https://code.launchpad.net/~aacid/qtubuntu/disabledMenus/+merge/319287

 * Did you perform an exploratory manual test run of your code change and any related functionality?
Yes

 * If you changed the packaging (debian), did you subscribe the ubuntu-unity team to this MP?
N/A

 * If you changed the UI, has there been a design review?
N/A

To post a comment you must log in.
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :

FAILED: Continuous integration, rev:2849
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/3313/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build/4361
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial+overlay,testname=qmluitests.sh/2607
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=zesty,testname=qmluitests.sh/2607
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/4389
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/4222
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/4222/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/4222
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/4222/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/4222
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/4222/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/4222
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/4222/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/4222
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/4222/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/4222
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/4222/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/3313/rebuild

review: Needs Fixing (continuous-integration)
lp:~aacid/unity8/disabledMenus updated
2850. By Albert Astals Cid

Merge

Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :

PASSED: Continuous integration, rev:2850
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/3349/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build/4405
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial+overlay,testname=qmluitests.sh/2637
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=zesty,testname=qmluitests.sh/2637
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/4433
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/4267
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/4267/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/4267
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/4267/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/4267
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/4267/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/4267
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/4267/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/4267
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/4267/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/4267
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/4267/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/3349/rebuild

review: Approve (continuous-integration)
Revision history for this message
Lukáš Tinkl (lukas-kde) wrote :

This too works fine, think you can add some test?

review: Needs Information
lp:~aacid/unity8/disabledMenus updated
2851. By Albert Astals Cid

Merge

2852. By Albert Astals Cid

Add tests

Revision history for this message
Albert Astals Cid (aacid) wrote :

> This too works fine, think you can add some test?

added.

Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :

PASSED: Continuous integration, rev:2851
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/3392/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build/4471
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial+overlay,testname=qmluitests.sh/2686
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=zesty,testname=qmluitests.sh/2686
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/4499
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/4326
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/4326/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/4326
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/4326/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/4326
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/4326/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/4326
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/4326/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/4326
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/4326/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/4326
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/4326/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/3392/rebuild

review: Approve (continuous-integration)
Revision history for this message
Lukáš Tinkl (lukas-kde) wrote :

* Did you perform an exploratory manual test run of the code change and any related functionality?

Yes

* Did CI run pass? If not, please explain why.

Yes

review: Approve
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :

FAILED: Continuous integration, rev:2852
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/3396/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build/4475
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial+overlay,testname=qmluitests.sh/2689
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=zesty,testname=qmluitests.sh/2689
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/4503
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/4330
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/4330/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/4330
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/4330/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/4330
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/4330/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/4330
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/4330/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/4330
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/4330/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/4330
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/4330/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/3396/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :

PASSED: Continuous integration, rev:2852
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/3427/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build/4519
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial+overlay,testname=qmluitests.sh/2718
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=zesty,testname=qmluitests.sh/2718
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/4547
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/4374
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/4374/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/4374
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/4374/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/4374
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/4374/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/4374
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/4374/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/4374
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/4374/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/4374
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/4374/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/3427/rebuild

review: Approve (continuous-integration)
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :

PASSED: Continuous integration, rev:2852
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/3460/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build/4563
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial+overlay,testname=qmluitests.sh/2748
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=zesty,testname=qmluitests.sh/2748
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/4591
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/4418
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/4418/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/4418
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/4418/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/4418
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/4418/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/4418
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/4418/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/4418
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/4418/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/4418
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/4418/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/3460/rebuild

review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'qml/Panel/MenuContent.qml'
--- qml/Panel/MenuContent.qml 2016-10-04 11:44:43 +0000
+++ qml/Panel/MenuContent.qml 2017-03-15 14:33:59 +0000
@@ -44,9 +44,9 @@
44 anchors.fill: parent44 anchors.fill: parent
45 model: content.model45 model: content.model
4646
47 highlightFollowsCurrentItem: true47 highlightFollowsCurrentItem: false
48 contentX: currentIndex * width
48 interactive: false49 interactive: false
49 highlightMoveDuration: 0
50 orientation: ListView.Horizontal50 orientation: ListView.Horizontal
51 // Load all the indicator menus (a big number)51 // Load all the indicator menus (a big number)
52 cacheBuffer: 107374182352 cacheBuffer: 1073741823
5353
=== modified file 'qml/Panel/Panel.qml'
--- qml/Panel/Panel.qml 2017-03-15 14:33:59 +0000
+++ qml/Panel/Panel.qml 2017-03-15 14:33:59 +0000
@@ -272,6 +272,7 @@
272 id: actionItem272 id: actionItem
273 property int ownIndex: index273 property int ownIndex: index
274 objectName: "appMenuItem"+index274 objectName: "appMenuItem"+index
275 enabled: model.sensitive
275276
276 width: _title.width + units.gu(2)277 width: _title.width + units.gu(2)
277 height: parent.height278 height: parent.height
278279
=== modified file 'qml/Panel/PanelBar.qml'
--- qml/Panel/PanelBar.qml 2017-01-16 08:51:52 +0000
+++ qml/Panel/PanelBar.qml 2017-03-15 14:33:59 +0000
@@ -44,6 +44,22 @@
44 row.selectItemAt(mapped.x);44 row.selectItemAt(mapped.x);
45 }45 }
4646
47 function selectPreviousItem() {
48 if (!expanded) {
49 row.resetCurrentItem();
50 }
51 row.selectPreviousItem();
52 d.alignIndicators();
53 }
54
55 function selectNextItem() {
56 if (!expanded) {
57 row.resetCurrentItem();
58 }
59 row.selectNextItem();
60 d.alignIndicators();
61 }
62
47 function setCurrentItemIndex(index) {63 function setCurrentItemIndex(index) {
48 if (!expanded) {64 if (!expanded) {
49 row.resetCurrentItem();65 row.resetCurrentItem();
5066
=== modified file 'qml/Panel/PanelItemRow.qml'
--- qml/Panel/PanelItemRow.qml 2017-01-24 17:34:19 +0000
+++ qml/Panel/PanelItemRow.qml 2017-03-15 14:33:59 +0000
@@ -96,31 +96,57 @@
96 row.currentIndex = -1;96 row.currentIndex = -1;
97 }97 }
9898
99 function selectPreviousItem() {
100 var indexToSelect = currentItemIndex - 1;
101 while (indexToSelect >= 0) {
102 if (setCurrentItemIndex(indexToSelect))
103 return;
104 indexToSelect = indexToSelect - 1;
105 }
106 }
107
108 function selectNextItem() {
109 var indexToSelect = currentItemIndex + 1;
110 while (indexToSelect < row.contentItem.children.length) {
111 if (setCurrentItemIndex(indexToSelect))
112 return;
113 indexToSelect = indexToSelect + 1;
114 }
115 }
116
99 function setCurrentItemIndex(index) {117 function setCurrentItemIndex(index) {
100 for (var i = 0; i < row.contentItem.children.length; i++) {118 for (var i = 0; i < row.contentItem.children.length; i++) {
101 var item = row.contentItem.children[i];119 var item = row.contentItem.children[i];
102 if (item.hasOwnProperty("ownIndex") && item.ownIndex === index) {120 if (item.hasOwnProperty("ownIndex") && item.ownIndex === index && item.enabled) {
103 if (currentItem !== item) row.currentIndex = index;121 if (currentItem !== item) {
104 break;122 row.currentIndex = index;
123 }
124 return true;
105 }125 }
106 }126 }
127 return false;
107 }128 }
108129
109 function selectItemAt(lateralPosition) {130 function selectItemAt(lateralPosition) {
110 var item = indicatorAt(lateralPosition, 0);131 var item = indicatorAt(lateralPosition, 0);
111 if (item && item.opacity > 0) {132 if (item && item.opacity > 0 && item.enabled) {
112 row.currentIndex = item.ownIndex;133 row.currentIndex = item.ownIndex;
113 } else {134 } else {
114 // Select default item.135 // Select default item.
115 var searchIndex = lateralPosition >= width ? row.count - 1 : 0;136 var searchIndex = lateralPosition >= width ? row.count - 1 : 0;
116137
117 for (var i = 0; i < row.contentItem.children.length; i++) {138 for (var i = 0; i < row.contentItem.children.length; i++) {
118 if (row.contentItem.children[i].hasOwnProperty("ownIndex") && row.contentItem.children[i].ownIndex === searchIndex) {139 if (row.contentItem.children[i].hasOwnProperty("ownIndex") &&
140 row.contentItem.children[i].ownIndex === searchIndex &&
141 row.contentItem.children[i].enabled)
142 {
119 item = row.contentItem.children[i];143 item = row.contentItem.children[i];
120 break;144 break;
121 }145 }
122 }146 }
123 if (currentItem !== item) row.currentIndex = item ? item.ownIndex : -1;147 if (item && currentItem !== item) {
148 row.currentIndex = item.ownIndex;
149 }
124 }150 }
125 }151 }
126152
127153
=== modified file 'qml/Panel/PanelMenu.qml'
--- qml/Panel/PanelMenu.qml 2017-03-15 14:33:59 +0000
+++ qml/Panel/PanelMenu.qml 2017-03-15 14:33:59 +0000
@@ -143,10 +143,10 @@
143143
144 Keys.onPressed: {144 Keys.onPressed: {
145 if (event.key === Qt.Key_Left) {145 if (event.key === Qt.Key_Left) {
146 bar.setCurrentItemIndex(bar.currentItemIndex - 1);146 bar.selectPreviousItem();
147 event.accepted = true;147 event.accepted = true;
148 } else if (event.key === Qt.Key_Right) {148 } else if (event.key === Qt.Key_Right) {
149 bar.setCurrentItemIndex(bar.currentItemIndex + 1);149 bar.selectNextItem();
150 event.accepted = true;150 event.accepted = true;
151 } else if (event.key === Qt.Key_Escape) {151 } else if (event.key === Qt.Key_Escape) {
152 root.hide();152 root.hide();
153153
=== modified file 'qml/Panel/PanelMenuPage.qml'
--- qml/Panel/PanelMenuPage.qml 2017-03-15 14:33:59 +0000
+++ qml/Panel/PanelMenuPage.qml 2017-03-15 14:33:59 +0000
@@ -63,7 +63,7 @@
63 if (model) {63 if (model) {
64 push(pageComponent, { "menuModel": model });64 push(pageComponent, { "menuModel": model });
65 }65 }
66 } else {66 } else if (root.currentPage) {
67 root.currentPage.reset();67 root.currentPage.reset();
68 }68 }
69 }69 }
7070
=== modified file 'tests/qmltests/ApplicationMenus/tst_MenuBar.qml'
--- tests/qmltests/ApplicationMenus/tst_MenuBar.qml 2017-03-15 14:33:59 +0000
+++ tests/qmltests/ApplicationMenus/tst_MenuBar.qml 2017-03-15 14:33:59 +0000
@@ -226,6 +226,30 @@
226 keyRelease(data.tag, Qt.AltModifier, 100);226 keyRelease(data.tag, Qt.AltModifier, 100);
227 }227 }
228228
229 function test_disabledTopLevel() {
230 var modelData = appMenuData.generateTestData(3,3,0,0,"menu");
231 modelData[1].rowData.sensitive = false;
232 menuBackend.modelData = modelData;
233
234 var priv = findInvisibleChild(menuBar, "d");
235
236 var menuItem0 = findChild(menuBar, "menuBar-item0"); verify(menuItem0);
237 var menuItem2 = findChild(menuBar, "menuBar-item2"); verify(menuItem2);
238
239 menuItem0.show();
240 compare(menuItem0.popupVisible, true, "Popup should be visible");
241
242 keyClick(Qt.Key_Right);
243 compare(priv.currentItem, menuItem2);
244 compare(menuItem2.popupVisible, true);
245 compare(menuItem0.popupVisible, false);
246
247 keyClick(Qt.Key_Left);
248 compare(priv.currentItem, menuItem0);
249 compare(menuItem2.popupVisible, false);
250 compare(menuItem0.popupVisible, true);
251 }
252
229 function test_menuActivateClosesMenu() {253 function test_menuActivateClosesMenu() {
230 menuBackend.modelData = appMenuData.generateTestData(3,3,0,0,"menu");254 menuBackend.modelData = appMenuData.generateTestData(3,3,0,0,"menu");
231 var priv = findInvisibleChild(menuBar, "d");255 var priv = findInvisibleChild(menuBar, "d");
232256
=== modified file 'tests/qmltests/Panel/tst_Panel.qml'
--- tests/qmltests/Panel/tst_Panel.qml 2017-03-15 14:33:59 +0000
+++ tests/qmltests/Panel/tst_Panel.qml 2017-03-15 14:33:59 +0000
@@ -872,5 +872,29 @@
872 keyClick(Qt.Key_Enter);872 keyClick(Qt.Key_Enter);
873 compare(aboutToShowCalledSpy.count, 1);873 compare(aboutToShowCalledSpy.count, 1);
874 }874 }
875
876 function test_disabledTopLevel() {
877 var modelData = appMenuData.generateTestData(3,3,0,0,"menu");
878 modelData[1].rowData.sensitive = false;
879 panel.applicationMenus.model.modelData = modelData;
880
881 waitForRendering(panel);
882
883 aboutToShowCalledSpy.target = panel.applicationMenus.model
884 aboutToShowCalledSpy.clear();
885
886 var indicatorsBar = findChild(panel.applicationMenus, "indicatorsBar");
887
888 PanelState.title = "Fake Title"
889 pullDownApplicationsMenu();
890
891 tryCompare(indicatorsBar, "currentItemIndex", 0);
892
893 keyClick(Qt.Key_Right);
894 tryCompare(indicatorsBar, "currentItemIndex", 2);
895
896 keyClick(Qt.Key_Left);
897 tryCompare(indicatorsBar, "currentItemIndex", 0);
898 }
875 }899 }
876}900}

Subscribers

People subscribed via source and target branches