Merge lp:~mterry/unity8/lockscreen-nits into lp:unity8/rtm-14.09
- lockscreen-nits
- Merge into rtm-14.09
Proposed by
Michał Sawicz
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Michał Sawicz | ||||
Approved revision: | 1010 | ||||
Merged at revision: | 1141 | ||||
Proposed branch: | lp:~mterry/unity8/lockscreen-nits | ||||
Merge into: | lp:unity8/rtm-14.09 | ||||
Diff against target: |
483 lines (+82/-125) 5 files modified
qml/Greeter/Greeter.qml (+9/-9) qml/Greeter/Infographics.qml (+52/-108) qml/Shell.qml (+6/-3) tests/autopilot/unity8/shell/emulators/greeter.py (+2/-1) tests/qmltests/tst_ShellWithPin.qml (+13/-4) |
||||
To merge this branch: | bzr merge lp:~mterry/unity8/lockscreen-nits | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Unity Team | Pending | ||
Review via email: mp+230463@code.launchpad.net |
Commit message
trunk/r1143: Fix a variety of design nits with the current lockscreen
Description of the change
To post a comment you must log in.
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'qml/Greeter/Greeter.qml' |
2 | --- qml/Greeter/Greeter.qml 2014-08-06 14:33:50 +0000 |
3 | +++ qml/Greeter/Greeter.qml 2014-08-12 11:40:17 +0000 |
4 | @@ -26,11 +26,12 @@ |
5 | created: greeterContentLoader.status == Loader.Ready && greeterContentLoader.item.ready |
6 | |
7 | property url defaultBackground |
8 | + property bool loadContent: required |
9 | |
10 | // 1 when fully shown and 0 when fully hidden |
11 | property real showProgress: MathUtils.clamp((width - Math.abs(x)) / width, 0, 1) |
12 | |
13 | - showAnimation: StandardAnimation { property: "x"; to: 0 } |
14 | + showAnimation: StandardAnimation { property: "x"; to: 0; duration: UbuntuAnimation.FastDuration } |
15 | hideAnimation: __leftHideAnimation |
16 | |
17 | property alias dragHandleWidth: dragHandle.width |
18 | @@ -58,10 +59,8 @@ |
19 | |
20 | onRequiredChanged: { |
21 | // Reset hide animation to default once we're finished with it |
22 | - if (!required) { |
23 | - // Put back on left for reliable show direction and so that |
24 | - // if normal hide() is called, we don't animate from right. |
25 | - x = -width |
26 | + if (required) { |
27 | + // Reset hide animation so that a hide() call is reliably left |
28 | hideAnimation = __leftHideAnimation |
29 | } |
30 | } |
31 | @@ -90,12 +89,13 @@ |
32 | onPressAndHold: {} // eat event, but no need to tease, as drag will cover it |
33 | |
34 | onDragEnd: { |
35 | - if (rightEvaluator.shouldAutoComplete()) |
36 | + if (greeter.x > 0 && rightEvaluator.shouldAutoComplete()) { |
37 | greeter.hideRight() |
38 | - else if (leftEvaluator.shouldAutoComplete()) |
39 | + } else if (greeter.x < 0 && leftEvaluator.shouldAutoComplete()) { |
40 | greeter.hide(); |
41 | - else |
42 | + } else { |
43 | greeter.show(); // undo drag |
44 | + } |
45 | } |
46 | |
47 | onDragValueChanged: { |
48 | @@ -127,7 +127,7 @@ |
49 | property var infographicModel: LightDM.Infographic |
50 | readonly property int backgroundTopMargin: -greeter.y |
51 | |
52 | - source: required ? "GreeterContent.qml" : "" |
53 | + source: loadContent ? "GreeterContent.qml" : "" |
54 | |
55 | onLoaded: { |
56 | selected(currentIndex); |
57 | |
58 | === modified file 'qml/Greeter/Infographics.qml' |
59 | --- qml/Greeter/Infographics.qml 2014-06-11 15:36:51 +0000 |
60 | +++ qml/Greeter/Infographics.qml 2014-08-12 11:40:17 +0000 |
61 | @@ -26,6 +26,9 @@ |
62 | |
63 | property int animDuration: 10 |
64 | |
65 | + property bool __useDotAnimation: true |
66 | + property int __circleModifier: __useDotAnimation ? 1 : 2 |
67 | + |
68 | Connections { |
69 | target: model |
70 | |
71 | @@ -41,19 +44,24 @@ |
72 | |
73 | function startShowAnimation() { |
74 | dotHideAnimTimer.stop() |
75 | - circleShrinkAnimTimer.stop() |
76 | notification.hideAnim.stop() |
77 | |
78 | - dotShowAnimTimer.startFromBeginning() |
79 | + if (__useDotAnimation) { |
80 | + dotShowAnimTimer.startFromBeginning() |
81 | + } |
82 | notification.showAnim.start() |
83 | } |
84 | |
85 | function startHideAnimation() { |
86 | dotShowAnimTimer.stop() |
87 | - circleGrowAnimTimer.stop() |
88 | + circleChangeAnimTimer.stop() |
89 | notification.showAnim.stop() |
90 | |
91 | - dotHideAnimTimer.startFromBeginning() |
92 | + if (__useDotAnimation) { |
93 | + dotHideAnimTimer.startFromBeginning() |
94 | + } else { |
95 | + circleChangeAnimTimer.startFromBeginning() |
96 | + } |
97 | notification.hideAnim.start() |
98 | } |
99 | |
100 | @@ -73,22 +81,22 @@ |
101 | anchors.centerIn: parent |
102 | |
103 | Timer { |
104 | - id: circleGrowAnimTimer |
105 | + id: circleChangeAnimTimer |
106 | |
107 | property int pastCircleCounter |
108 | property int presentCircleCounter |
109 | |
110 | - interval: animDuration |
111 | + interval: notification.duration |
112 | running: false |
113 | repeat: true |
114 | onTriggered: { |
115 | if (pastCircleCounter < pastCircles.count) { |
116 | var nextCircle = pastCircles.itemAt(pastCircleCounter++) |
117 | - if (nextCircle !== null) nextCircle.pastCircleGrowAnim.start() |
118 | + if (nextCircle !== null) nextCircle.pastCircleChangeAnim.start() |
119 | } |
120 | if (pastCircleCounter > pastCircles.count / 2) { |
121 | var nextCircle = presentCircles.itemAt(presentCircleCounter++) |
122 | - if (nextCircle !== null) nextCircle.presentCircleGrowAnim.start() |
123 | + if (nextCircle !== null) nextCircle.presentCircleChangeAnim.start() |
124 | } |
125 | if (presentCircleCounter > infographic.model.currentDay && pastCircleCounter >= pastCircles.count) { |
126 | stop() |
127 | @@ -96,39 +104,8 @@ |
128 | } |
129 | |
130 | function startFromBeginning() { |
131 | - circleGrowAnimTimer.pastCircleCounter = 0 |
132 | - circleGrowAnimTimer.presentCircleCounter = 0 |
133 | - start() |
134 | - } |
135 | - } |
136 | - |
137 | - Timer { |
138 | - id: circleShrinkAnimTimer |
139 | - |
140 | - property int pastCircleCounter |
141 | - property int presentCircleCounter |
142 | - |
143 | - interval: animDuration |
144 | - running: false |
145 | - repeat: true |
146 | - onTriggered: { |
147 | - if (pastCircleCounter >= 0) { |
148 | - var nextCircle = pastCircles.itemAt(pastCircleCounter--) |
149 | - if (nextCircle !== null) nextCircle.pastCircleShrinkAnim.start() |
150 | - } |
151 | - if (pastCircleCounter < pastCircles.count / 2) { |
152 | - var nextCircle = presentCircles.itemAt(presentCircleCounter--) |
153 | - if (nextCircle !== null) nextCircle.presentCircleShrinkAnim.start() |
154 | - } |
155 | - if (presentCircleCounter < 0) { |
156 | - stop() |
157 | - infographic.model.readyForDataChange() |
158 | - } |
159 | - } |
160 | - |
161 | - function startFromBeginning() { |
162 | - pastCircleCounter = pastCircles.count - 1 |
163 | - presentCircleCounter = model.currentDay |
164 | + circleChangeAnimTimer.pastCircleCounter = 0 |
165 | + circleChangeAnimTimer.presentCircleCounter = 0 |
166 | start() |
167 | } |
168 | } |
169 | @@ -139,8 +116,7 @@ |
170 | model: infographic.model.secondMonth |
171 | |
172 | delegate: ObjectPositioner { |
173 | - property alias pastCircleGrowAnim: pastCircleGrowAnim |
174 | - property alias pastCircleShrinkAnim: pastCircleShrinkAnim |
175 | + property alias pastCircleChangeAnim: pastCircleChangeAnim |
176 | |
177 | index: model.index |
178 | count: pastCircles.count |
179 | @@ -160,52 +136,33 @@ |
180 | opacity: 0.0 |
181 | scale: 0.0 |
182 | visible: modelData !== undefined |
183 | - color: Gradient.threeColorByIndex(index, count, infographic.model.secondColor) |
184 | + color: "transparent" |
185 | |
186 | SequentialAnimation { |
187 | - id: pastCircleGrowAnim |
188 | + id: pastCircleChangeAnim |
189 | |
190 | loops: 1 |
191 | ParallelAnimation { |
192 | PropertyAnimation { |
193 | target: pastCircle |
194 | property: "opacity" |
195 | - from: 0.0 |
196 | to: pastCircle.circleOpacity |
197 | easing.type: Easing.OutCurve |
198 | - duration: circleGrowAnimTimer.interval * 4 |
199 | + duration: circleChangeAnimTimer.interval * __circleModifier |
200 | } |
201 | PropertyAnimation { |
202 | target: pastCircle |
203 | property: "scale" |
204 | - from: 0.0 |
205 | to: modelData |
206 | easing.type: Easing.OutCurve |
207 | - duration: circleGrowAnimTimer.interval * 4 |
208 | - } |
209 | - } |
210 | - } |
211 | - |
212 | - SequentialAnimation { |
213 | - id: pastCircleShrinkAnim |
214 | - |
215 | - loops: 1 |
216 | - ParallelAnimation { |
217 | - PropertyAnimation { |
218 | - target: pastCircle |
219 | - property: "opacity" |
220 | - from: pastCircle.circleOpacity |
221 | - to: 0.0 |
222 | - easing.type: Easing.OutCurve |
223 | - duration: circleShrinkAnimTimer.interval * 4 |
224 | - } |
225 | - PropertyAnimation { |
226 | - target: pastCircle |
227 | - property: "scale" |
228 | - from: modelData |
229 | - to: 0.0 |
230 | - easing.type: Easing.OutCurve |
231 | - duration: circleShrinkAnimTimer.interval * 4 |
232 | + duration: circleChangeAnimTimer.interval * __circleModifier |
233 | + } |
234 | + ColorAnimation { |
235 | + target: pastCircle |
236 | + property: "color" |
237 | + to: Gradient.threeColorByIndex(index, count, infographic.model.secondColor) |
238 | + easing.type: Easing.OutCurve |
239 | + duration: circleChangeAnimTimer.interval * __circleModifier |
240 | } |
241 | } |
242 | } |
243 | @@ -219,8 +176,7 @@ |
244 | model: infographic.model.firstMonth |
245 | |
246 | delegate: ObjectPositioner { |
247 | - property alias presentCircleGrowAnim: presentCircleGrowAnim |
248 | - property alias presentCircleShrinkAnim: presentCircleShrinkAnim |
249 | + property alias presentCircleChangeAnim: presentCircleChangeAnim |
250 | |
251 | index: model.index |
252 | count: presentCircles.count |
253 | @@ -240,10 +196,10 @@ |
254 | opacity: 0.0 |
255 | scale: 0.0 |
256 | visible: modelData !== undefined |
257 | - color: Gradient.threeColorByIndex(index, infographic.model.currentDay, infographic.model.firstColor) |
258 | + color: "transparent" |
259 | |
260 | SequentialAnimation { |
261 | - id: presentCircleGrowAnim |
262 | + id: presentCircleChangeAnim |
263 | |
264 | loops: 1 |
265 | |
266 | @@ -253,36 +209,21 @@ |
267 | property: "opacity" |
268 | to: presentCircle.circleOpacity |
269 | easing.type: Easing.OutCurve |
270 | - duration: circleGrowAnimTimer.interval * 4 |
271 | + duration: circleChangeAnimTimer.interval * __circleModifier |
272 | } |
273 | PropertyAnimation { |
274 | target: presentCircle |
275 | property: "scale" |
276 | to: modelData |
277 | easing.type: Easing.OutCurve |
278 | - duration: circleGrowAnimTimer.interval * 4 |
279 | - } |
280 | - } |
281 | - } |
282 | - |
283 | - SequentialAnimation { |
284 | - id: presentCircleShrinkAnim |
285 | - |
286 | - loops: 1 |
287 | - ParallelAnimation { |
288 | - PropertyAnimation { |
289 | - target: presentCircle |
290 | - property: "opacity" |
291 | - to: 0.0 |
292 | - easing.type: Easing.OutCurve |
293 | - duration: circleShrinkAnimTimer.interval * 4 |
294 | - } |
295 | - PropertyAnimation { |
296 | - target: presentCircle |
297 | - property: "scale" |
298 | - to: 0.0 |
299 | - easing.type: Easing.OutCurve |
300 | - duration: circleShrinkAnimTimer.interval * 4 |
301 | + duration: circleChangeAnimTimer.interval * __circleModifier |
302 | + } |
303 | + ColorAnimation { |
304 | + target: presentCircle |
305 | + property: "color" |
306 | + to: Gradient.threeColorByIndex(index, infographic.model.currentDay, infographic.model.firstColor) |
307 | + easing.type: Easing.OutCurve |
308 | + duration: circleChangeAnimTimer.interval * __circleModifier |
309 | } |
310 | } |
311 | } |
312 | @@ -313,7 +254,7 @@ |
313 | stop() |
314 | } |
315 | if (dotCounter == Math.round(dots.count / 2)) { |
316 | - circleGrowAnimTimer.startFromBeginning() |
317 | + circleChangeAnimTimer.startFromBeginning() |
318 | } |
319 | } |
320 | |
321 | @@ -340,8 +281,8 @@ |
322 | } else { |
323 | stop() |
324 | } |
325 | - if (dotCounter == Math.round(dots.count / 2)) { |
326 | - circleShrinkAnimTimer.startFromBeginning() |
327 | + if (dotCounter == 0) { |
328 | + infographic.model.readyForDataChange() |
329 | } |
330 | } |
331 | |
332 | @@ -413,6 +354,7 @@ |
333 | property alias showAnim: increaseOpacity |
334 | |
335 | property real baseOpacity: 0.6 |
336 | + property real duration: dotShowAnimTimer.interval * 5 |
337 | |
338 | height: 0.7 * backgroundCircle.width |
339 | width: notification.height |
340 | @@ -432,7 +374,7 @@ |
341 | property: "opacity" |
342 | from: 0.0 |
343 | to: notification.baseOpacity |
344 | - duration: dotShowAnimTimer.interval * dots.count * 5 |
345 | + duration: notification.duration * dots.count |
346 | } |
347 | |
348 | PropertyAnimation { |
349 | @@ -442,7 +384,8 @@ |
350 | property: "opacity" |
351 | from: notification.baseOpacity |
352 | to: 0.0 |
353 | - duration: dotShowAnimTimer.interval * dots.count * 5 |
354 | + duration: notification.duration * dots.count |
355 | + onStopped: if (!__useDotAnimation) infographic.model.readyForDataChange() |
356 | } |
357 | } |
358 | } |
359 | @@ -453,9 +396,10 @@ |
360 | onDoubleClicked: { |
361 | if (!dotHideAnimTimer.running && |
362 | !dotShowAnimTimer.running && |
363 | - !circleShrinkAnimTimer.running && |
364 | - !circleGrowAnimTimer.running) |
365 | + !circleChangeAnimTimer.running) { |
366 | + __useDotAnimation = false |
367 | infographic.model.nextDataSource() |
368 | + } |
369 | } |
370 | |
371 | onClicked: mouse.accepted = false |
372 | |
373 | === modified file 'qml/Shell.qml' |
374 | --- qml/Shell.qml 2014-08-06 19:39:07 +0000 |
375 | +++ qml/Shell.qml 2014-08-12 11:40:17 +0000 |
376 | @@ -48,6 +48,8 @@ |
377 | property url background |
378 | readonly property real panelHeight: panel.panelHeight |
379 | |
380 | + readonly property bool locked: LightDM.Greeter.active && !LightDM.Greeter.authenticated |
381 | + |
382 | property bool sideStageEnabled: shell.width >= units.gu(100) |
383 | readonly property string focusedApplicationId: ApplicationManager.focusedApplicationId |
384 | |
385 | @@ -323,6 +325,7 @@ |
386 | available: true |
387 | hides: [launcher, panel.indicators] |
388 | shown: true |
389 | + loadContent: required || lockscreen.required // keeps content in memory for quick show() |
390 | |
391 | defaultBackground: shell.background |
392 | |
393 | @@ -412,7 +415,7 @@ |
394 | } |
395 | |
396 | function showDash() { |
397 | - if (LightDM.Greeter.active && !LightDM.Greeter.promptless) { |
398 | + if (shell.locked) { |
399 | return; |
400 | } |
401 | if (greeter.shown) { |
402 | @@ -436,7 +439,7 @@ |
403 | anchors.fill: parent //because this draws indicator menus |
404 | indicators { |
405 | hides: [launcher] |
406 | - available: edgeDemo.panelEnabled && greeter.fakeActiveForApp === "" |
407 | + available: edgeDemo.panelEnabled && !shell.locked |
408 | contentEnabled: edgeDemo.panelContentEnabled |
409 | width: parent.width > units.gu(60) ? units.gu(40) : parent.width |
410 | panelHeight: units.gu(3) |
411 | @@ -460,7 +463,7 @@ |
412 | anchors.bottom: parent.bottom |
413 | width: parent.width |
414 | dragAreaWidth: shell.edgeSize |
415 | - available: edgeDemo.launcherEnabled && greeter.fakeActiveForApp === "" |
416 | + available: edgeDemo.launcherEnabled && !shell.locked |
417 | |
418 | onShowDashHome: showHome() |
419 | onDash: showDash() |
420 | |
421 | === modified file 'tests/autopilot/unity8/shell/emulators/greeter.py' |
422 | --- tests/autopilot/unity8/shell/emulators/greeter.py 2014-07-30 18:22:44 +0000 |
423 | +++ tests/autopilot/unity8/shell/emulators/greeter.py 2014-08-12 11:40:17 +0000 |
424 | @@ -28,6 +28,7 @@ |
425 | def swipe(self): |
426 | """Swipe the greeter screen away.""" |
427 | self.created.wait_for(True) |
428 | + self.showProgress.wait_for(1) |
429 | |
430 | rect = self.globalRect |
431 | start_x = rect[0] + rect[2] - 3 |
432 | @@ -36,7 +37,7 @@ |
433 | stop_y = start_y |
434 | self.pointing_device.drag(start_x, start_y, stop_x, stop_y) |
435 | |
436 | - self.created.wait_for(False) |
437 | + self.showProgress.wait_for(0) |
438 | |
439 | def get_prompt(self): |
440 | return self.select_single( |
441 | |
442 | === modified file 'tests/qmltests/tst_ShellWithPin.qml' |
443 | --- tests/qmltests/tst_ShellWithPin.qml 2014-07-29 11:35:10 +0000 |
444 | +++ tests/qmltests/tst_ShellWithPin.qml 2014-08-12 11:40:17 +0000 |
445 | @@ -116,6 +116,14 @@ |
446 | tryCompare(sessionSpy, "count", 1) |
447 | } |
448 | |
449 | + function test_disabledEdges() { |
450 | + var launcher = findChild(shell, "launcher") |
451 | + tryCompare(launcher, "available", false) |
452 | + |
453 | + var indicators = findChild(shell, "indicators") |
454 | + tryCompare(indicators, "available", false) |
455 | + } |
456 | + |
457 | function test_emergencyCall() { |
458 | var greeter = findChild(shell, "greeter") |
459 | var lockscreen = findChild(shell, "lockscreen") |
460 | @@ -130,10 +138,13 @@ |
461 | tryCompare(greeter, "fakeActiveForApp", "dialer-app") |
462 | tryCompare(lockscreen, "shown", false) |
463 | tryCompare(panel, "fullscreenMode", true) |
464 | - tryCompare(indicators, "available", false) |
465 | - tryCompare(launcher, "available", false) |
466 | tryCompare(stage, "spreadEnabled", false) |
467 | |
468 | + // These are normally false anyway, but confirm they remain so in |
469 | + // emergency mode. |
470 | + tryCompare(launcher, "available", false) |
471 | + tryCompare(indicators, "available", false) |
472 | + |
473 | // Cancel emergency mode, and go back to normal |
474 | waitForRendering(greeter) |
475 | LightDM.Greeter.showGreeter() |
476 | @@ -142,8 +153,6 @@ |
477 | tryCompare(greeter, "fakeActiveForApp", "") |
478 | tryCompare(lockscreen, "shown", true) |
479 | tryCompare(panel, "fullscreenMode", false) |
480 | - tryCompare(indicators, "available", true) |
481 | - tryCompare(launcher, "available", true) |
482 | tryCompare(stage, "spreadEnabled", true) |
483 | } |
484 |