Merge lp:~mzanetti/unity8/appdrawer-improvements into lp:unity8

Proposed by Michael Zanetti on 2016-12-13
Status: Merged
Approved by: Albert Astals Cid on 2017-01-16
Approved revision: 2737
Merged at revision: 2787
Proposed branch: lp:~mzanetti/unity8/appdrawer-improvements
Merge into: lp:unity8
Prerequisite: lp:~lukas-kde/unity8/appdrawer-direct-search
Diff against target: 891 lines (+236/-166)
18 files modified
data/com.canonical.Unity8.gschema.xml (+5/-0)
plugins/Utils/appdrawerproxymodel.cpp (+1/-1)
qml/Launcher/Drawer.qml (+78/-5)
qml/Launcher/DrawerGridView.qml (+3/-1)
qml/Launcher/DrawerListView.qml (+6/-0)
qml/Launcher/Launcher.qml (+6/-10)
qml/Launcher/LauncherDelegate.qml (+8/-9)
qml/Launcher/LauncherPanel.qml (+11/-6)
qml/Launcher/MoreAppsHeader.qml (+12/-5)
qml/Launcher/graphics/launcher-app-focus-ring.svg (+0/-12)
qml/Shell.qml (+16/-4)
tests/mocks/GSettings.1.0/fake_gsettings.cpp (+14/-0)
tests/mocks/GSettings.1.0/fake_gsettings.h (+7/-0)
tests/qmltests/Dash/tst_DashShell.qml (+0/-40)
tests/qmltests/Launcher/tst_Drawer.qml (+42/-3)
tests/qmltests/Launcher/tst_Launcher.qml (+5/-6)
tests/qmltests/tst_Shell.qml (+5/-64)
tests/qmltests/tst_ShellWithPin.qml (+17/-0)
To merge this branch: bzr merge lp:~mzanetti/unity8/appdrawer-improvements
Reviewer Review Type Date Requested Status
Albert Astals Cid (community) Abstain on 2017-01-16
Unity8 CI Bot continuous-integration 2016-12-13 Approve on 2017-01-16
Lukáš Tinkl (community) 2016-12-13 Approve on 2017-01-10
Review via email: mp+313139@code.launchpad.net

Commit Message

Improvements for the appdrawer

Allow cancelling of the reveal gesture
move the app store uri to a gsetting

Description of the Change

 * Are there any related MPs required for this MP to build/function as expected? Please list.
no
 * 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?
yes, vesa checked it out

To post a comment you must log in.
Vesa Rautiainen (vesar) wrote :

Reviewed these changes with Michael -> approved by design

Lukáš Tinkl (lukas-kde) wrote :

Looking good, waiting on CI for the top approval

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

Not yet

review: Approve
Unity8 CI Bot (unity8-ci-bot) wrote :

FAILED: Continuous integration, rev:2735
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/2851/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build/3729
    FAILURE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial+overlay,testname=qmluitests.sh/2148/console
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=zesty,testname=qmluitests.sh/2148
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/3757
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/3602
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/3602/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/3602
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/3602/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/3602
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/3602/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/3602
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/3602/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/3602
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/3602/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/3602
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/3602/artifact/output/*zip*/output.zip

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

review: Needs Fixing (continuous-integration)
Lukáš Tinkl (lukas-kde) wrote :

There are some failing tests:

qmltestrunner.DashShell::test_setShellHome
qmltestrunner.Launcher::test_keyboardNavigation
qmltestrunner.NarrowView::test_doubleTapSwitchesToNextInfographic
qmltestrunner.Shell::test_ClickUbuntuIconInLauncherTakesToAppsAndResetSearchString
qmltestrunner.Shell::test_focusAppFromLauncherExitsSpread
qmltestrunner.Shell::test_superTabToCycleLauncher
qmltestrunner.Shell::test_tapUbuntuIconInLauncherOverAppSpread

review: Needs Fixing
Unity8 CI Bot (unity8-ci-bot) wrote :

FAILED: Continuous integration, rev:2736
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/2866/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build/3744
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial+overlay,testname=qmluitests.sh/2160
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=zesty,testname=qmluitests.sh/2160
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/3772
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/3616
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/3616/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/3616
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/3616/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/3616
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/3616/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/3616
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/3616/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/3616
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/3616/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/3616
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/3616/artifact/output/*zip*/output.zip

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

review: Needs Fixing (continuous-integration)
Unity8 CI Bot (unity8-ci-bot) wrote :

FAILED: Continuous integration, rev:2736
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/2868/
Executed test runs:
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build/3746/console
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/3774
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/3618
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/3618/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/3618
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/3618/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/3618
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/3618/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/3618
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/3618/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/3618
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/3618/artifact/output/*zip*/output.zip
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/3618/console

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

review: Needs Fixing (continuous-integration)
Unity8 CI Bot (unity8-ci-bot) wrote :

PASSED: Continuous integration, rev:2736
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/2872/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build/3750
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial+overlay,testname=qmluitests.sh/2163
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=zesty,testname=qmluitests.sh/2163
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/3778
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/3622
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/3622/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/3622
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/3622/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/3622
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/3622/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/3622
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/3622/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/3622
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/3622/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/3622
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/3622/artifact/output/*zip*/output.zip

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

review: Approve (continuous-integration)
Lukáš Tinkl (lukas-kde) wrote :

CI green, let's call it done

review: Approve
Albert Astals Cid (aacid) wrote :

Doesn't build, remove the change from tests/mocks/Unity/Launcher/MockAppDrawerModel.cpp

review: Needs Fixing
2737. By Michael Zanetti on 2017-01-16

merge prereq

Michael Zanetti (mzanetti) wrote :

> Doesn't build, remove the change from
> tests/mocks/Unity/Launcher/MockAppDrawerModel.cpp

done

Unity8 CI Bot (unity8-ci-bot) wrote :

PASSED: Continuous integration, rev:2737
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/2898/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build/3782
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial+overlay,testname=qmluitests.sh/2193
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=zesty,testname=qmluitests.sh/2193
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/3810
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/3654
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/3654/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/3654
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/3654/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/3654
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/3654/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/3654
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/3654/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/3654
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/3654/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/3654
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/3654/artifact/output/*zip*/output.zip

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

review: Approve (continuous-integration)
Albert Astals Cid (aacid) :
review: Abstain
2738. By Michael Zanetti on 2017-01-23

adjust home key to still focus the dash instead of messing with the drawer

2739. By Michael Zanetti on 2017-01-23

add a test

2740. By Michael Zanetti on 2017-01-23

try to catch a crash in case we're getting bad indexes

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'data/com.canonical.Unity8.gschema.xml'
2--- data/com.canonical.Unity8.gschema.xml 2016-11-30 10:32:23 +0000
3+++ data/com.canonical.Unity8.gschema.xml 2017-01-16 11:12:35 +0000
4@@ -53,6 +53,11 @@
5 <summary>Enable or disable the indicator pull down menus</summary>
6 <description>Toggle the availability of the indicator pull down menus</description>
7 </key>
8+ <key type="s" name="appstore-uri">
9+ <default>'scope://com.canonical.scopes.clickstore'</default>
10+ <summary>The uri to the app store</summary>
11+ <description>This will be used whenever the user triggers an action to open the app store.</description>
12+ </key>
13 </schema>
14
15 <schema path="/com/canonical/unity8/greeter/" id="com.canonical.Unity8.Greeter" gettext-domain="unity8">
16
17=== modified file 'plugins/Utils/appdrawerproxymodel.cpp'
18--- plugins/Utils/appdrawerproxymodel.cpp 2016-12-23 11:04:53 +0000
19+++ plugins/Utils/appdrawerproxymodel.cpp 2017-01-16 11:12:35 +0000
20@@ -185,5 +185,5 @@
21 return adpm->appId(sourceIndex.row());
22 }
23 }
24- return nullptr;
25+ return QString();
26 }
27
28=== modified file 'qml/Launcher/Drawer.qml'
29--- qml/Launcher/Drawer.qml 2017-01-16 11:12:35 +0000
30+++ qml/Launcher/Drawer.qml 2017-01-16 11:12:35 +0000
31@@ -20,6 +20,7 @@
32 import Utils 0.1
33 import "../Components"
34 import Qt.labs.settings 1.0
35+import GSettings 1.0
36
37 FocusScope {
38 id: root
39@@ -47,8 +48,10 @@
40 if (event.text.trim() !== "") {
41 focusInput();
42 searchField.text = event.text;
43- event.accepted = true;
44 }
45+ // Catch all presses here in case the navigation lets something through
46+ // We never want to end up in the launcher with focus
47+ event.accepted = true;
48 }
49
50 Settings {
51@@ -88,6 +91,9 @@
52 anchors { left: parent.left; top: parent.top; right: parent.right; margins: units.gu(1) }
53 placeholderText: i18n.tr("Search…")
54 focus: true
55+
56+ KeyNavigation.down: sections
57+
58 onAccepted: {
59 if (searchField.displayText != "" && listLoader.item && listLoader.item.currentItem) {
60 root.applicationSelected(listLoader.item.getFirstAppId());
61@@ -104,7 +110,14 @@
62
63 Sections {
64 id: sections
65+ objectName: "drawerSections"
66 width: parent.width
67+
68+ KeyNavigation.up: searchField
69+ KeyNavigation.down: headerFocusScope
70+ KeyNavigation.backtab: searchField
71+ KeyNavigation.tab: headerFocusScope
72+
73 actions: [
74 Action {
75 text: i18n.ctr("Apps sorted alphabetically", "A-Z")
76@@ -124,9 +137,45 @@
77 }
78 }
79
80+ FocusScope {
81+ id: headerFocusScope
82+ objectName: "headerFocusScope"
83+ KeyNavigation.up: sections
84+ KeyNavigation.down: listLoader.item
85+ KeyNavigation.backtab: sections
86+ KeyNavigation.tab: listLoader.item
87+ activeFocusOnTab: true
88+
89+ GSettings {
90+ id: settings
91+ schema.id: "com.canonical.Unity8"
92+ }
93+
94+ Keys.onPressed: {
95+ switch (event.key) {
96+ case Qt.Key_Return:
97+ case Qt.Key_Enter:
98+ case Qt.Key_Space:
99+ trigger();
100+ event.accepted = true;
101+ }
102+ }
103+
104+ function trigger() {
105+ Qt.openUrlExternally(settings.appstoreUri)
106+ }
107+ }
108+
109 Loader {
110 id: listLoader
111- anchors { left: parent.left; top: sectionsContainer.bottom; right: parent.right; bottom: parent.bottom; leftMargin: units.gu(1); rightMargin: units.gu(1) }
112+ objectName: "drawerListLoader"
113+ anchors { left: parent.left; top: sectionsContainer.bottom; right: parent.right; bottom: parent.bottom }
114+
115+ KeyNavigation.up: headerFocusScope
116+ KeyNavigation.down: searchField
117+ KeyNavigation.backtab: headerFocusScope
118+ KeyNavigation.tab: searchField
119+
120 sourceComponent: {
121 switch (sections.selectedIndex) {
122 case 0: return aToZComponent;
123@@ -176,10 +225,13 @@
124 Component {
125 id: mostUsedComponent
126 DrawerListView {
127+ id: mostUsedListView
128
129 header: MoreAppsHeader {
130 width: parent.width
131 height: units.gu(6)
132+ highlighted: headerFocusScope.activeFocus
133+ onClicked: headerFocusScope.trigger();
134 }
135
136 model: AppDrawerProxyModel {
137@@ -189,7 +241,8 @@
138 }
139
140 delegate: UbuntuShape {
141- width: parent.width
142+ width: parent.width - units.gu(2)
143+ anchors.horizontalCenter: parent.horizontalCenter
144 color: "#20ffffff"
145 aspect: UbuntuShape.Flat
146 // NOTE: Cannot use gridView.rows here as it would evaluate to 0 at first and only update later,
147@@ -205,6 +258,9 @@
148 bottomMargin: units.gu(1)
149 clip: true
150
151+ interactive: true
152+ focus: index == mostUsedListView.currentIndex
153+
154 model: sortProxyModel
155
156 delegateWidth: units.gu(8)
157@@ -218,10 +274,13 @@
158 Component {
159 id: aToZComponent
160 DrawerListView {
161+ id: aToZListView
162
163 header: MoreAppsHeader {
164 width: parent.width
165 height: units.gu(6)
166+ highlighted: headerFocusScope.activeFocus
167+ onClicked: headerFocusScope.trigger();
168 }
169
170 model: AppDrawerProxyModel {
171@@ -231,7 +290,8 @@
172 }
173
174 delegate: UbuntuShape {
175- width: parent.width
176+ width: parent.width - units.gu(2)
177+ anchors.horizontalCenter: parent.horizontalCenter
178 color: "#20ffffff"
179 aspect: UbuntuShape.Flat
180
181@@ -253,7 +313,8 @@
182 anchors { left: parent.left; top: categoryNameLabel.bottom; right: parent.right; topMargin: units.gu(1) }
183 height: rows * delegateHeight
184
185- interactive: false
186+ interactive: true
187+ focus: index == aToZListView.currentIndex
188
189 model: AppDrawerProxyModel {
190 id: categoryModel
191@@ -272,10 +333,13 @@
192 Component {
193 id: drawerDelegateComponent
194 AbstractButton {
195+ id: drawerDelegate
196 width: GridView.view.cellWidth
197 height: units.gu(10)
198 objectName: "drawerItem_" + model.appId
199
200+ readonly property bool focused: index === GridView.view.currentIndex && GridView.view.activeFocus
201+
202 onClicked: root.applicationSelected(model.appId)
203
204 Column {
205@@ -299,6 +363,15 @@
206 source: model.icon
207 }
208 sourceFillMode: UbuntuShape.PreserveAspectCrop
209+
210+ StyledItem {
211+ styleName: "FocusShape"
212+ anchors.fill: parent
213+ StyleHints {
214+ visible: drawerDelegate.focused
215+ radius: units.gu(2.55)
216+ }
217+ }
218 }
219
220 Label {
221
222=== modified file 'qml/Launcher/DrawerGridView.qml'
223--- qml/Launcher/DrawerGridView.qml 2016-11-10 14:39:18 +0000
224+++ qml/Launcher/DrawerGridView.qml 2017-01-16 11:12:35 +0000
225@@ -17,7 +17,7 @@
226 import QtQuick 2.4
227 import "../Components"
228
229-Item {
230+FocusScope {
231 id: root
232
233 property int delegateWidth: units.gu(10)
234@@ -25,6 +25,7 @@
235 property alias delegate: gridView.delegate
236 property alias model: gridView.model
237 property alias interactive: gridView.interactive
238+ property alias currentIndex: gridView.currentIndex
239
240 property alias header: gridView.header
241 property alias topMargin: gridView.topMargin
242@@ -37,6 +38,7 @@
243 id: gridView
244 anchors.fill: parent
245 leftMargin: spacing
246+ focus: true
247
248 readonly property int overflow: width - (root.columns * root.delegateWidth)
249 readonly property real spacing: overflow / (root.columns)
250
251=== modified file 'qml/Launcher/DrawerListView.qml'
252--- qml/Launcher/DrawerListView.qml 2016-11-28 14:56:02 +0000
253+++ qml/Launcher/DrawerListView.qml 2017-01-16 11:12:35 +0000
254@@ -25,6 +25,12 @@
255 bottomMargin: units.gu(1)
256 spacing: units.gu(1)
257 clip: true
258+ focus: true
259+
260+ onActiveFocusChanged: {
261+ currentIndex = -1;
262+ currentIndex = 0;
263+ }
264
265 function getFirstAppId() {
266 return model.appId(0);
267
268=== modified file 'qml/Launcher/Launcher.qml'
269--- qml/Launcher/Launcher.qml 2017-01-16 11:12:35 +0000
270+++ qml/Launcher/Launcher.qml 2017-01-16 11:12:35 +0000
271@@ -87,14 +87,14 @@
272 superPressTimer.stop();
273 superLongPressTimer.stop();
274 } else {
275+ switchToNextState("");
276+ root.focus = false;
277 if (panel.highlightIndex == -1) {
278- showDashHome();
279+ root.showDashHome();
280 } else if (panel.highlightIndex >= 0){
281 launcherApplicationSelected(LauncherModel.get(panel.highlightIndex).appId);
282 }
283 panel.highlightIndex = -2;
284- switchToNextState("");
285- root.focus = false;
286 }
287 }
288
289@@ -206,7 +206,7 @@
290 case Qt.Key_Return:
291 case Qt.Key_Space:
292 if (panel.highlightIndex == -1) {
293- showDashHome();
294+ root.showDashHome();
295 } else if (panel.highlightIndex >= 0) {
296 launcherApplicationSelected(LauncherModel.get(panel.highlightIndex).appId);
297 }
298@@ -469,9 +469,7 @@
299 }
300 onPassed: {
301 if (root.drawerEnabled) {
302- root.switchToNextState("drawer");
303- root.focus = true;
304- drawer.focus = true;
305+ root.openDrawer()
306 }
307 }
308
309@@ -547,9 +545,7 @@
310 if (!dragging) {
311 if (distance > panel.width / 2) {
312 if (root.drawerEnabled && distance > panel.width * 3 && dragDirection() !== "left") {
313- root.switchToNextState("drawer");
314- root.focus = true;
315- drawer.focus = true;
316+ root.openDrawer(false)
317 } else {
318 root.switchToNextState("visible");
319 }
320
321=== modified file 'qml/Launcher/LauncherDelegate.qml'
322--- qml/Launcher/LauncherDelegate.qml 2016-09-26 11:58:56 +0000
323+++ qml/Launcher/LauncherDelegate.qml 2017-01-16 11:12:35 +0000
324@@ -124,15 +124,14 @@
325 height: parent.itemHeight + units.gu(1)
326 anchors.centerIn: parent
327
328- Image {
329- objectName: "focusRing"
330- anchors.centerIn: iconShape
331- height: width * 15 / 16
332- width: iconShape.width + units.gu(1)
333- source: "graphics/launcher-app-focus-ring.svg"
334- sourceSize.width: width
335- sourceSize.height: height
336- visible: root.highlighted
337+ StyledItem {
338+ styleName: "FocusShape"
339+ anchors.fill: iconShape
340+ activeFocusOnTab: true
341+ StyleHints {
342+ visible: root.highlighted
343+ radius: units.gu(2.55)
344+ }
345 }
346
347 ProportionalShape {
348
349=== modified file 'qml/Launcher/LauncherPanel.qml'
350--- qml/Launcher/LauncherPanel.qml 2017-01-10 14:44:00 +0000
351+++ qml/Launcher/LauncherPanel.qml 2017-01-16 11:12:35 +0000
352@@ -80,6 +80,7 @@
353 }
354
355 Rectangle {
356+ id: bfb
357 objectName: "buttonShowDashHome"
358 width: parent.width
359 height: width * .9
360@@ -100,13 +101,15 @@
361 activeFocusOnPress: false
362 onClicked: root.showDashHome()
363 }
364- Rectangle {
365- objectName: "bfbFocusHighlight"
366+
367+ StyledItem {
368+ styleName: "FocusShape"
369 anchors.fill: parent
370- border.color: "white"
371- border.width: units.dp(1)
372- color: "transparent"
373- visible: parent.highlighted
374+ anchors.margins: units.gu(.5)
375+ StyleHints {
376+ visible: bfb.highlighted
377+ radius: 0
378+ }
379 }
380 }
381
382@@ -788,6 +791,8 @@
383 quickList.model = launcherListView.model.get(index).quickList;
384 quickList.appId = launcherListView.model.get(index).appId;
385 quickList.state = "open";
386+ root.highlightIndex = index;
387+ quickList.forceActiveFocus();
388 }
389
390 Item {
391
392=== modified file 'qml/Launcher/MoreAppsHeader.qml'
393--- qml/Launcher/MoreAppsHeader.qml 2016-11-04 10:10:26 +0000
394+++ qml/Launcher/MoreAppsHeader.qml 2017-01-16 11:12:35 +0000
395@@ -4,17 +4,24 @@
396 AbstractButton {
397 id: root
398
399- onClicked: {
400- // TODO: Make this point to the snappy store as soon as we stop landing to vivid
401- Qt.openUrlExternally("scope://com.canonical.scopes.clickstore")
402- }
403+ property bool highlighted: false
404
405 UbuntuShape {
406- width: parent.width
407+ width: parent.width - units.gu(2)
408+ anchors.horizontalCenter: parent.horizontalCenter
409 height: parent.height - units.gu(1)
410 color: "#20ffffff"
411 aspect: UbuntuShape.Flat
412
413+ StyledItem {
414+ styleName: "FocusShape"
415+ anchors.fill: parent
416+ activeFocusOnTab: true
417+ StyleHints {
418+ visible: root.highlighted
419+ }
420+ }
421+
422 Row {
423 anchors.fill: parent
424 anchors.margins: units.gu(1)
425
426=== removed file 'qml/Launcher/graphics/launcher-app-focus-ring.svg'
427--- qml/Launcher/graphics/launcher-app-focus-ring.svg 2015-12-15 12:53:53 +0000
428+++ qml/Launcher/graphics/launcher-app-focus-ring.svg 1970-01-01 00:00:00 +0000
429@@ -1,12 +0,0 @@
430-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
431-<svg width="172px" height="163px" viewBox="0 0 172 163" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:sketch="http://www.bohemiancoding.com/sketch/ns">
432- <!-- Generator: Sketch 3.4.4 (17249) - http://www.bohemiancoding.com/sketch -->
433- <title>Shape</title>
434- <desc>Created with Sketch.</desc>
435- <defs></defs>
436- <g id="•-Launcher" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" sketch:type="MSPage">
437- <g id="Artboard-9" sketch:type="MSArtboardGroup" transform="translate(-163.000000, -1436.000000)" fill="#E95420">
438- <path d="M221.983432,1440 L221.983432,1440 C195.6127,1440 184.708233,1442.4723 177.107949,1450.10734 C169.476819,1457.77336 167,1468.79245 167,1495.3481 L167,1538.9019 C167,1565.45755 169.476819,1576.47664 177.107949,1584.14266 C184.708233,1591.7777 195.6127,1594.25 221.983432,1594.25 L276.016868,1594.25 C302.387595,1594.25 313.291998,1591.77771 320.892221,1584.14264 C328.523252,1576.47663 331,1565.45769 331,1538.9019 L331,1495.3481 C331,1468.79231 328.523252,1457.77337 320.892221,1450.10736 C313.291998,1442.47229 302.387595,1440 276.016868,1440 L221.983432,1440 Z M221.983432,1436 L276.016868,1436 C302.345315,1436 314.848953,1438.36655 323.727108,1447.2854 C332.633306,1456.23243 335,1468.85167 335,1495.3481 L335,1538.9019 C335,1565.39833 332.633306,1578.01757 323.727108,1586.9646 C314.848953,1595.88345 302.345315,1598.25 276.016868,1598.25 L221.983432,1598.25 C195.654985,1598.25 183.151291,1595.88345 174.273077,1586.96463 C165.366772,1578.0176 163,1565.39822 163,1538.9019 L163,1495.3481 C163,1468.85178 165.366772,1456.2324 174.273077,1447.28537 C183.151291,1438.36655 195.654985,1436 221.983432,1436 L221.983432,1436 Z" id="Shape" sketch:type="MSShapeGroup"></path>
439- </g>
440- </g>
441-</svg>
442\ No newline at end of file
443
444=== modified file 'qml/Shell.qml'
445--- qml/Shell.qml 2017-01-03 12:04:08 +0000
446+++ qml/Shell.qml 2017-01-16 11:12:35 +0000
447@@ -343,6 +343,16 @@
448 onLoaded: {
449 item.objectName = "greeter"
450 }
451+ property bool openDrawerAfterUnlock: false
452+ Connections {
453+ target: greeter
454+ onActiveChanged: {
455+ if (!greeter.active && greeterLoader.openDrawerAfterUnlock) {
456+ launcher.openDrawer(false);
457+ greeterLoader.openDrawerAfterUnlock = false;
458+ }
459+ }
460+ }
461 }
462
463 Component {
464@@ -434,9 +444,11 @@
465 if (shell.mode === "greeter") {
466 SessionBroadcast.requestHomeShown(AccountsService.user);
467 } else {
468- var animate = !LightDMService.greeter.active && !stages.shown;
469- dash.setCurrentScope(0, animate, false);
470- ApplicationManager.requestFocusApplication("unity8-dash");
471+ if (!greeter.active) {
472+ launcher.openDrawer(false);
473+ } else {
474+ greeterLoader.openDrawerAfterUnlock = true;
475+ }
476 }
477 }
478
479@@ -512,7 +524,7 @@
480 lockedVisible: shell.usageScenario == "desktop" && !settings.autohideLauncher && !panel.fullscreenMode
481 blurSource: greeter.shown ? greeter : stages
482 topPanelHeight: panel.panelHeight
483- drawerEnabled: !greeter.shown
484+ drawerEnabled: !greeter.active
485
486 onShowDashHome: showHome()
487 onLauncherApplicationSelected: {
488
489=== modified file 'tests/mocks/GSettings.1.0/fake_gsettings.cpp'
490--- tests/mocks/GSettings.1.0/fake_gsettings.cpp 2016-11-16 05:54:50 +0000
491+++ tests/mocks/GSettings.1.0/fake_gsettings.cpp 2017-01-16 11:12:35 +0000
492@@ -29,6 +29,7 @@
493 , m_edgeDragWidth(2)
494 , m_enableLauncher(true)
495 , m_enableIndicatorMenu(true)
496+ , m_appstoreUri("http://uappexplorer.com")
497 {
498 }
499
500@@ -173,6 +174,11 @@
501 }
502 }
503
504+QString GSettingsControllerQml::appstoreUri() const
505+{
506+ return m_appstoreUri;
507+}
508+
509 GSettingsSchemaQml::GSettingsSchemaQml(QObject *parent): QObject(parent) {
510 }
511
512@@ -376,6 +382,14 @@
513 }
514 }
515
516+QVariant GSettingsQml::appstoreUri() const
517+{
518+ if (m_valid && m_schema->id() == "com.canonical.Unity8") {
519+ return GSettingsControllerQml::instance()->appstoreUri();
520+ }
521+ return QVariant();
522+}
523+
524 void GSettingsQml::setLifecycleExemptAppids(const QVariant &appIds)
525 {
526 if (m_valid && m_schema->id() == "com.canonical.qtmir") {
527
528=== modified file 'tests/mocks/GSettings.1.0/fake_gsettings.h'
529--- tests/mocks/GSettings.1.0/fake_gsettings.h 2016-11-16 05:54:50 +0000
530+++ tests/mocks/GSettings.1.0/fake_gsettings.h 2017-01-16 11:12:35 +0000
531@@ -59,6 +59,7 @@
532 Q_PROPERTY(QVariant edgeDragWidth READ edgeDragWidth WRITE setEdgeDragWidth NOTIFY edgeDragWidthChanged)
533 Q_PROPERTY(QVariant enableLauncher READ enableLauncher WRITE setEnableLauncher NOTIFY enableLauncherChanged)
534 Q_PROPERTY(QVariant enableIndicatorMenu READ enableIndicatorMenu WRITE setEnableIndicatorMenu NOTIFY enableIndicatorMenuChanged)
535+ Q_PROPERTY(QVariant appstoreUri READ appstoreUri NOTIFY appstoreUriChanged)
536
537 public:
538 GSettingsQml(QObject *parent = nullptr);
539@@ -77,6 +78,7 @@
540 QVariant edgeDragWidth() const;
541 QVariant enableLauncher() const;
542 QVariant enableIndicatorMenu() const;
543+ QVariant appstoreUri() const;
544
545 void setDisableHeight(const QVariant &val);
546 void setPictureUri(const QVariant &str);
547@@ -101,6 +103,7 @@
548 void edgeDragWidthChanged();
549 void enableLauncherChanged();
550 void enableIndicatorMenuChanged();
551+ void appstoreUriChanged();
552
553 private:
554 GSettingsSchemaQml* m_schema;
555@@ -147,6 +150,8 @@
556 bool enableIndicatorMenu() const;
557 Q_INVOKABLE void setEnableIndicatorMenu(bool enableIndicatorMenu);
558
559+ QString appstoreUri() const;
560+
561 Q_SIGNALS:
562 void disableHeightChanged();
563 void pictureUriChanged(const QString&);
564@@ -158,6 +163,7 @@
565 void edgeDragWidthChanged(uint edgeDragWidth);
566 void enableLauncherChanged(bool enableLauncher);
567 void enableIndicatorMenuChanged(bool enableIndicatorMenu);
568+ void appstoreUriChanged(const QString &appstoreUri);
569
570 private:
571 GSettingsControllerQml();
572@@ -172,6 +178,7 @@
573 uint m_edgeDragWidth;
574 bool m_enableLauncher;
575 bool m_enableIndicatorMenu;
576+ QString m_appstoreUri;
577
578 static GSettingsControllerQml* s_controllerInstance;
579 QList<GSettingsQml *> m_registeredGSettings;
580
581=== modified file 'tests/qmltests/Dash/tst_DashShell.qml'
582--- tests/qmltests/Dash/tst_DashShell.qml 2016-12-14 17:43:23 +0000
583+++ tests/qmltests/Dash/tst_DashShell.qml 2017-01-16 11:12:35 +0000
584@@ -72,45 +72,5 @@
585 true, 15000);
586 waitForRendering(findChild(dash, "scopeLoader0").item);
587 }
588-
589- function test_setShellHome() {
590- var dashContentList = findChild(dash, "dashContentList");
591- var startX = dash.width - units.gu(1);
592- var startY = dash.height / 2;
593- var stopX = units.gu(1)
594- var stopY = startY;
595- waitForRendering(dashContentList);
596- touchFlick(dash, startX, startY, stopX, stopY);
597- touchFlick(dash, startX, startY, stopX, stopY);
598- compare(dashContentList.currentIndex, 2, "Could not flick to scope id 2");
599-
600- // Flick the greeter away
601- var startX = shell.width - units.gu(1);
602- var startY = shell.height / 2;
603- var stopX = units.gu(1)
604- var stopY = startY;
605- touchFlick(shell, startX, startY, stopX, stopY);
606-
607- var greeter = findChild(shell, "greeter");
608- tryCompare(greeter, "shown", false);
609-
610- // bring in the launcher
611- var startX = units.gu(1);
612- var startY = shell.height / 2;
613- var stopX = shell.width / 3;
614- var stopY = startY;
615- touchFlick(shell, startX, startY, stopX, stopY);
616-
617- var launcher = findChild(shell, "launcher");
618- var buttonShowDashHome = findChild(launcher, "buttonShowDashHome");
619- tryCompare(buttonShowDashHome, "enabled", true);
620- tryCompare(launcher, "visibleWidth", launcher.panelWidth);
621-
622- // Make sure that opening the launcher doesn't change the scope
623- compare(dashContentList.currentIndex, 2, "Opening the launcher changed the current scope");
624-
625- mouseClick(buttonShowDashHome);
626- tryCompare(dashContentList, "currentIndex", 0);
627- }
628 }
629 }
630
631=== modified file 'tests/qmltests/Launcher/tst_Drawer.qml'
632--- tests/qmltests/Launcher/tst_Drawer.qml 2017-01-16 11:12:35 +0000
633+++ tests/qmltests/Launcher/tst_Drawer.qml 2017-01-16 11:12:35 +0000
634@@ -136,6 +136,8 @@
635 launcher.hide();
636 var drawer = findChild(launcher, "drawer");
637 tryCompare(drawer, "x", -drawer.width);
638+ var searchField = findChild(drawer, "searchField");
639+ searchField.text = "";
640 }
641
642 function test_revealByEdgeDrag() {
643@@ -173,7 +175,7 @@
644 var drawer = dragDrawerIntoView();
645 waitForRendering(launcher);
646
647- mouseFlick(root, drawer.width - units.gu(1), drawer.height / 2, units.gu(2), drawer.height / 2, true, true);
648+ mouseFlick(root, drawer.width - units.gu(1), drawer.height / 2, units.gu(10), drawer.height / 2, true, true);
649
650 tryCompare(drawer.anchors, "rightMargin", 0);
651 tryCompare(launcher, "state", data.endState);
652@@ -263,8 +265,8 @@
653
654 function test_searchDirectly() {
655 var drawer = dragDrawerIntoView();
656- waitForRendering(drawer);
657- waitUntilTransitionsEnd(drawer);
658+ waitForRendering(launcher);
659+ waitUntilTransitionsEnd(launcher);
660 tryCompare(drawer, "focus", true);
661
662 var searchField = findChild(drawer, "searchField");
663@@ -272,5 +274,42 @@
664 typeString("cam");
665 tryCompareFunction(function() { return searchField.displayText }, "cam");
666 }
667+
668+ function test_kbdNavigation() {
669+ launcher.openDrawer(true);
670+ waitForRendering(launcher);
671+ waitUntilTransitionsEnd(launcher);
672+ compare(launcher.lastSelectedApplication, "");
673+
674+ var drawer = findChild(launcher, "drawer");
675+ var searchField = findChild(drawer, "searchField");
676+ var sections = findChild(drawer, "drawerSections");
677+ var header = findChild(drawer, "headerFocusScope");
678+ var listLoader = findChild(drawer, "drawerListLoader");
679+
680+ tryCompare(searchField, "activeFocus", true);
681+ // for some reason, even when the searchField has activeFocus already,
682+ // it won't react on key down events if they're coming in too early...
683+ // let's repeat the press for a bit before giving up
684+ tryCompareFunction(function() {
685+ wait(10)
686+ keyClick(Qt.Key_Down);
687+ return sections.activeFocus;
688+ }, true)
689+
690+ keyClick(Qt.Key_Down);
691+ tryCompare(header, "activeFocus", true);
692+
693+ keyClick(Qt.Key_Down);
694+ tryCompare(listLoader, "activeFocus", true);
695+
696+ keyClick(Qt.Key_Down);
697+ keyClick(Qt.Key_Left);
698+ tryCompare(listLoader, "activeFocus", true);
699+
700+ keyClick(Qt.Key_Enter);
701+
702+ compare(launcher.lastSelectedApplication, "calendar-app");
703+ }
704 }
705 }
706
707=== modified file 'tests/qmltests/Launcher/tst_Launcher.qml'
708--- tests/qmltests/Launcher/tst_Launcher.qml 2016-12-07 13:43:25 +0000
709+++ tests/qmltests/Launcher/tst_Launcher.qml 2017-01-16 11:12:35 +0000
710@@ -369,18 +369,17 @@
711 function assertFocusOnIndex(index) {
712 var launcherPanel = findChild(launcher, "launcherPanel");
713 var launcherListView = findChild(launcher, "launcherListView");
714- var bfbFocusHighlight = findChild(launcher, "bfbFocusHighlight");
715+ var bfb = findChild(launcher, "buttonShowDashHome");
716
717 waitForRendering(launcher);
718 tryCompare(launcherPanel, "highlightIndex", index);
719- compare(bfbFocusHighlight.visible, index === -1);
720+ compare(bfb.highlighted, index === -1);
721 for (var i = 0; i < launcherListView.count; i++) {
722 var item = findChild(launcher, "launcherDelegate" + i);
723 // Delegates might be destroyed when not visible. We can't check if they paint a focus highlight.
724 // Make sure the requested index does have focus. for the others, try best effort to check if they don't
725 if (index === i || item) {
726- var focusRing = findChild(item, "focusRing")
727- tryCompare(focusRing, "visible", index === i);
728+ tryCompare(item, "highlighted", index === i);
729 }
730 }
731 }
732@@ -1188,13 +1187,13 @@
733 }
734
735 function test_keyboardNavigation(data) {
736- var bfbFocusHighlight = findChild(launcher, "bfbFocusHighlight");
737+ var bfb = findChild(launcher, "buttonShowDashHome");
738 var quickList = findChild(launcher, "quickList");
739 var launcherPanel = findChild(launcher, "launcherPanel");
740 var launcherListView = findChild(launcher, "launcherListView");
741 var last = launcherListView.count - 1;
742
743- compare(bfbFocusHighlight.visible, false);
744+ compare(bfb.highlighted, false);
745 launcher.openForKeyboardNavigation();
746 tryCompare(launcherPanel, "x", 0);
747 waitForRendering(launcher);
748
749=== modified file 'tests/qmltests/tst_Shell.qml'
750--- tests/qmltests/tst_Shell.qml 2017-01-09 14:10:17 +0000
751+++ tests/qmltests/tst_Shell.qml 2017-01-16 11:12:35 +0000
752@@ -747,22 +747,6 @@
753 mockNotificationsModel.append(n)
754 }
755
756- function test_ClickUbuntuIconInLauncherTakesToAppsAndResetSearchString() {
757- loadShell("phone");
758- swipeAwayGreeter();
759- dragLauncherIntoView();
760- dashCommunicatorSpy.clear();
761-
762- var launcher = findChild(shell, "launcher");
763- var dashIcon = findChild(launcher, "dashItem");
764- verify(dashIcon != undefined);
765- mouseClick(dashIcon);
766-
767- tryCompare(ApplicationManager, "focusedApplicationId", "unity8-dash");
768-
769- compare(dashCommunicatorSpy.count, 1);
770- }
771-
772 function test_suspend() {
773 loadShell("phone");
774 swipeAwayGreeter();
775@@ -1380,47 +1364,6 @@
776 tryCompare(stage, "state", "spread");
777 }
778
779- function test_tapUbuntuIconInLauncherOverAppSpread() {
780- launcherShowDashHomeSpy.clear();
781-
782- loadShell("phone");
783- swipeAwayGreeter();
784-
785- waitUntilFocusedApplicationIsShowingItsSurface();
786-
787- swipeFromRightEdgeToShowAppSpread();
788-
789- var launcher = findChild(shell, "launcher");
790-
791- dragLauncherIntoView();
792-
793- // Emulate a tap with a finger, where the touch position drifts during the tap.
794- // This is to test the touch ownership changes. The tap is happening on the button
795- // area but then drifting into the left edge drag area. This test makes sure
796- // the touch ownership stays with the button and doesn't move over to the
797- // left edge drag area.
798- {
799- var buttonShowDashHome = findChild(launcher, "buttonShowDashHome");
800- touchFlick(buttonShowDashHome,
801- buttonShowDashHome.width * 0.2, /* startPos.x */
802- buttonShowDashHome.height * 0.8, /* startPos.y */
803- buttonShowDashHome.width * 0.8, /* endPos.x */
804- buttonShowDashHome.height * 0.2 /* endPos.y */);
805- }
806-
807- compare(launcherShowDashHomeSpy.count, 1);
808-
809- // check that the stage has left spread mode.
810- {
811- var stage = findChild(shell, "stage");
812- tryCompare(stage, "state", "staged");
813- }
814-
815- // check that the launcher got dismissed
816- var launcherPanel = findChild(shell, "launcherPanel");
817- tryCompare(launcherPanel, "x", -launcherPanel.width);
818- }
819-
820 function test_physicalHomeKeyPressDoesNothingWithActiveGreeter() {
821 loadShell("phone");
822
823@@ -1847,7 +1790,7 @@
824 loadDesktopShellWithApps()
825 var launcher = findChild(shell, "launcher");
826 var stage = findChild(shell, "stage");
827- var bfb = findChild(launcher, "buttonShowDashHome");
828+ var app1 = findChild(launcher, "launcherDelegate0");
829
830 GSettingsController.setAutohideLauncher(!data.launcherLocked);
831 waitForRendering(shell);
832@@ -1860,17 +1803,17 @@
833 if (!data.launcherLocked) {
834 revealLauncherByEdgePushWithMouse();
835 tryCompare(launcher, "x", 0);
836- mouseMove(bfb, bfb.width / 2, bfb.height / 2)
837+ mouseMove(app1, app1.width / 2, app1.height / 2)
838 waitForRendering(shell)
839 }
840
841- mouseClick(bfb, bfb.width / 2, bfb.height / 2)
842+ mouseClick(app1, app1.width / 2, app1.height / 2)
843 if (!data.launcherLocked) {
844 tryCompare(launcher, "state", "")
845 }
846 tryCompare(stage, "state", "windowed")
847
848- tryCompare(ApplicationManager, "focusedApplicationId", "unity8-dash")
849+ tryCompare(ApplicationManager, "focusedApplicationId", "dialer-app")
850
851 keyRelease(Qt.Key_Alt);
852 }
853@@ -2194,10 +2137,8 @@
854 tryCompare(launcher, "state", "visible");
855 tryCompare(launcherPanel, "highlightIndex", -1);
856 keyRelease(Qt.Key_Super_L, Qt.MetaModifier);
857- tryCompare(launcher, "state", data.launcherLocked ? "visible" : "");
858+ tryCompare(launcher, "state", "drawer");
859 tryCompare(launcherPanel, "highlightIndex", -2);
860- tryCompare(ApplicationManager, "focusedApplicationId", "unity8-dash");
861- tryCompare(stage, "focus", true)
862 }
863
864 function test_longpressSuperOpensLauncherAndShortcutsOverlay() {
865
866=== modified file 'tests/qmltests/tst_ShellWithPin.qml'
867--- tests/qmltests/tst_ShellWithPin.qml 2017-01-03 12:04:08 +0000
868+++ tests/qmltests/tst_ShellWithPin.qml 2017-01-16 11:12:35 +0000
869@@ -558,5 +558,22 @@
870 var lockscreen = findChild(shell, "lockscreen");
871 verify(lockscreen.shown);
872 }
873+
874+ function test_bfbOnLockedDevice() {
875+ var launcher = findChild(shell, "launcher");
876+ touchFlick(shell, units.gu(.5), shell.height / 2, units.gu(10), shell.height / 2);
877+
878+ tryCompare(launcher, "x", 0);
879+ tryCompare(launcher, "state", "visible");
880+
881+ waitForRendering(shell)
882+
883+ var bfb = findChild(launcher, "buttonShowDashHome");
884+ mouseClick(bfb, bfb.width / 2, bfb.height / 2);
885+
886+ enterPin("1234")
887+
888+ tryCompare(launcher, "state", "drawer");
889+ }
890 }
891 }

Subscribers

People subscribed via source and target branches