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

Proposed by Albert Astals Cid
Status: Approved
Approved by: Andrea Cimitan
Approved revision: 2915
Proposed branch: lp:~aacid/unity8/fixLauncherUpDownKeys
Merge into: lp:unity8
Prerequisite: lp:~aacid/unity8/closeQuicklistOnFocusMove
Diff against target: 126 lines (+46/-11)
2 files modified
qml/Launcher/LauncherPanel.qml (+11/-10)
tests/qmltests/Launcher/tst_Launcher.qml (+35/-1)
To merge this branch: bzr merge lp:~aacid/unity8/fixLauncherUpDownKeys
Reviewer Review Type Date Requested Status
Andrea Cimitan (community) Approve
Unity8 CI Bot continuous-integration Approve
Review via email: mp+321883@code.launchpad.net

Commit message

Fix Up/Down after Tab with quicklist open

Description of the change

 * Are there any related MPs required for this MP to build/function as expected?
Prereq

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

 * 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 :

PASSED: Continuous integration, rev:2915
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/3669/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build/4870
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial+overlay,testname=qmluitests.sh/2986
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=zesty,testname=qmluitests.sh/2986
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/4898
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/4709
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/4709/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/4709
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/4709/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/4709
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/4709/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/4709
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/4709/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/4709
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/4709/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/4709
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/4709/artifact/output/*zip*/output.zip

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

review: Approve (continuous-integration)
Revision history for this message
Andrea Cimitan (cimi) wrote :

 * Did you perform an exploratory manual test run of the code change and any related functionality?
Yes, this one works fine too
 * Did CI run pass? If not, please explain why.
It passed

review: Approve

Unmerged revisions

2915. By Albert Astals Cid

Fix Up/Down after Tab with quicklist open

2914. By Albert Astals Cid

Hide quicklist when launcher index changes

While at it fix a few verify calls that wanted to be compare

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'qml/Launcher/LauncherPanel.qml'
2--- qml/Launcher/LauncherPanel.qml 2017-04-04 16:03:27 +0000
3+++ qml/Launcher/LauncherPanel.qml 2017-04-04 16:03:27 +0000
4@@ -43,13 +43,16 @@
5 signal showDashHome()
6 signal kbdNavigationCancelled()
7
8- onXChanged: {
9+ onXChanged: closeQuickList();
10+
11+ function closeQuickList() {
12 if (quickList.state === "open") {
13- quickList.state = ""
14+ quickList.state = "";
15+ quickList.focus = false;
16 }
17 }
18
19- onHighlightIndexChanged: quickList.state = ""
20+ onHighlightIndexChanged: closeQuickList();
21
22 function highlightNext() {
23 highlightIndex++;
24@@ -562,7 +565,7 @@
25 var distance = Math.max(Math.abs(mouse.x - startX), Math.abs(mouse.y - startY))
26 if (!preDragging && distance > units.gu(1.5)) {
27 preDragging = true;
28- quickList.state = "";
29+ closeQuickList();
30 }
31 if (distance > launcherListView.itemHeight) {
32 selectedItem.dragging = true
33@@ -697,8 +700,7 @@
34 visible: enabled
35
36 onClicked: {
37- quickList.state = "";
38- quickList.focus = false;
39+ closeQuickList();
40 root.kbdNavigationCancelled();
41 }
42
43@@ -772,7 +774,7 @@
44 case Qt.Key_Escape:
45 quickList.selectedIndex = -1;
46 quickList.focus = false;
47- quickList.state = ""
48+ closeQuickList();
49 event.accepted = true;
50 break;
51 case Qt.Key_Enter:
52@@ -783,7 +785,7 @@
53 }
54 quickList.selectedIndex = -1;
55 quickList.focus = false;
56- quickList.state = ""
57+ closeQuickList();
58 root.kbdNavigationCancelled();
59 event.accepted = true;
60 break;
61@@ -869,11 +871,10 @@
62 return;
63 }
64 Haptics.play();
65- quickList.state = "";
66+ closeQuickList();
67 // Unsetting model to prevent showing changing entries during fading out
68 // that may happen because of triggering an action.
69 LauncherModel.quickListActionInvoked(quickList.appId, index);
70- quickList.focus = false;
71 root.kbdNavigationCancelled();
72 quickList.model = undefined;
73 }
74
75=== modified file 'tests/qmltests/Launcher/tst_Launcher.qml'
76--- tests/qmltests/Launcher/tst_Launcher.qml 2017-04-04 16:03:27 +0000
77+++ tests/qmltests/Launcher/tst_Launcher.qml 2017-04-04 16:03:27 +0000
78@@ -1280,7 +1280,9 @@
79
80 function test_selectQuicklistItemByKeyboard() {
81 launcher.openForKeyboardNavigation();
82- waitForRendering(launcher);
83+
84+ var launcherPanel = findChild(launcher, "launcherPanel");
85+ tryCompareFunction( function(){ return launcherPanel.x === 0; }, true );
86
87 signalSpy.signalName = "quickListTriggered"
88
89@@ -1586,5 +1588,37 @@
90 compare(quickList.state, "")
91 tryCompare(launcherPanel, "highlightIndex", 3);
92 }
93+
94+ function test_upDownAfterQuickList() {
95+
96+ dragLauncherIntoView();
97+ var clickedItem = findChild(launcher, "launcherDelegate2")
98+ var quickList = findChild(launcher, "quickList")
99+ var launcherPanel = findChild(launcher, "launcherPanel");
100+
101+ launcherLoader.item.openForKeyboardNavigation()
102+ launcherLoader.item.forceActiveFocus();
103+
104+ tryCompare(launcherPanel, "highlightIndex", -1);
105+
106+ keyClick(Qt.Key_Tab);
107+ tryCompare(launcherPanel, "highlightIndex", 0);
108+
109+ keyClick(Qt.Key_Down);
110+ tryCompare(launcherPanel, "highlightIndex", 1);
111+
112+ keyClick(Qt.Key_Right);
113+ compare(quickList.state, "open")
114+ tryCompare(launcherPanel, "highlightIndex", 1);
115+
116+ keyClick(Qt.Key_Tab);
117+ tryCompare(launcherPanel, "highlightIndex", 2);
118+
119+ keyClick(Qt.Key_Down);
120+ tryCompare(launcherPanel, "highlightIndex", 3);
121+
122+ keyClick(Qt.Key_Up);
123+ tryCompare(launcherPanel, "highlightIndex", 2);
124+ }
125 }
126 }

Subscribers

People subscribed via source and target branches