Merge lp:~mterry/unity8/lockscreen-nits into lp:unity8/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
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

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
=== modified file 'qml/Greeter/Greeter.qml'
--- qml/Greeter/Greeter.qml 2014-08-06 14:33:50 +0000
+++ qml/Greeter/Greeter.qml 2014-08-12 11:40:17 +0000
@@ -26,11 +26,12 @@
26 created: greeterContentLoader.status == Loader.Ready && greeterContentLoader.item.ready26 created: greeterContentLoader.status == Loader.Ready && greeterContentLoader.item.ready
2727
28 property url defaultBackground28 property url defaultBackground
29 property bool loadContent: required
2930
30 // 1 when fully shown and 0 when fully hidden31 // 1 when fully shown and 0 when fully hidden
31 property real showProgress: MathUtils.clamp((width - Math.abs(x)) / width, 0, 1)32 property real showProgress: MathUtils.clamp((width - Math.abs(x)) / width, 0, 1)
3233
33 showAnimation: StandardAnimation { property: "x"; to: 0 }34 showAnimation: StandardAnimation { property: "x"; to: 0; duration: UbuntuAnimation.FastDuration }
34 hideAnimation: __leftHideAnimation35 hideAnimation: __leftHideAnimation
3536
36 property alias dragHandleWidth: dragHandle.width37 property alias dragHandleWidth: dragHandle.width
@@ -58,10 +59,8 @@
5859
59 onRequiredChanged: {60 onRequiredChanged: {
60 // Reset hide animation to default once we're finished with it61 // Reset hide animation to default once we're finished with it
61 if (!required) {62 if (required) {
62 // Put back on left for reliable show direction and so that63 // Reset hide animation so that a hide() call is reliably left
63 // if normal hide() is called, we don't animate from right.
64 x = -width
65 hideAnimation = __leftHideAnimation64 hideAnimation = __leftHideAnimation
66 }65 }
67 }66 }
@@ -90,12 +89,13 @@
90 onPressAndHold: {} // eat event, but no need to tease, as drag will cover it89 onPressAndHold: {} // eat event, but no need to tease, as drag will cover it
9190
92 onDragEnd: {91 onDragEnd: {
93 if (rightEvaluator.shouldAutoComplete())92 if (greeter.x > 0 && rightEvaluator.shouldAutoComplete()) {
94 greeter.hideRight()93 greeter.hideRight()
95 else if (leftEvaluator.shouldAutoComplete())94 } else if (greeter.x < 0 && leftEvaluator.shouldAutoComplete()) {
96 greeter.hide();95 greeter.hide();
97 else96 } else {
98 greeter.show(); // undo drag97 greeter.show(); // undo drag
98 }
99 }99 }
100100
101 onDragValueChanged: {101 onDragValueChanged: {
@@ -127,7 +127,7 @@
127 property var infographicModel: LightDM.Infographic127 property var infographicModel: LightDM.Infographic
128 readonly property int backgroundTopMargin: -greeter.y128 readonly property int backgroundTopMargin: -greeter.y
129129
130 source: required ? "GreeterContent.qml" : ""130 source: loadContent ? "GreeterContent.qml" : ""
131131
132 onLoaded: {132 onLoaded: {
133 selected(currentIndex);133 selected(currentIndex);
134134
=== modified file 'qml/Greeter/Infographics.qml'
--- qml/Greeter/Infographics.qml 2014-06-11 15:36:51 +0000
+++ qml/Greeter/Infographics.qml 2014-08-12 11:40:17 +0000
@@ -26,6 +26,9 @@
2626
27 property int animDuration: 1027 property int animDuration: 10
2828
29 property bool __useDotAnimation: true
30 property int __circleModifier: __useDotAnimation ? 1 : 2
31
29 Connections {32 Connections {
30 target: model33 target: model
3134
@@ -41,19 +44,24 @@
4144
42 function startShowAnimation() {45 function startShowAnimation() {
43 dotHideAnimTimer.stop()46 dotHideAnimTimer.stop()
44 circleShrinkAnimTimer.stop()
45 notification.hideAnim.stop()47 notification.hideAnim.stop()
4648
47 dotShowAnimTimer.startFromBeginning()49 if (__useDotAnimation) {
50 dotShowAnimTimer.startFromBeginning()
51 }
48 notification.showAnim.start()52 notification.showAnim.start()
49 }53 }
5054
51 function startHideAnimation() {55 function startHideAnimation() {
52 dotShowAnimTimer.stop()56 dotShowAnimTimer.stop()
53 circleGrowAnimTimer.stop()57 circleChangeAnimTimer.stop()
54 notification.showAnim.stop()58 notification.showAnim.stop()
5559
56 dotHideAnimTimer.startFromBeginning()60 if (__useDotAnimation) {
61 dotHideAnimTimer.startFromBeginning()
62 } else {
63 circleChangeAnimTimer.startFromBeginning()
64 }
57 notification.hideAnim.start()65 notification.hideAnim.start()
58 }66 }
5967
@@ -73,22 +81,22 @@
73 anchors.centerIn: parent81 anchors.centerIn: parent
7482
75 Timer {83 Timer {
76 id: circleGrowAnimTimer84 id: circleChangeAnimTimer
7785
78 property int pastCircleCounter86 property int pastCircleCounter
79 property int presentCircleCounter87 property int presentCircleCounter
8088
81 interval: animDuration89 interval: notification.duration
82 running: false90 running: false
83 repeat: true91 repeat: true
84 onTriggered: {92 onTriggered: {
85 if (pastCircleCounter < pastCircles.count) {93 if (pastCircleCounter < pastCircles.count) {
86 var nextCircle = pastCircles.itemAt(pastCircleCounter++)94 var nextCircle = pastCircles.itemAt(pastCircleCounter++)
87 if (nextCircle !== null) nextCircle.pastCircleGrowAnim.start()95 if (nextCircle !== null) nextCircle.pastCircleChangeAnim.start()
88 }96 }
89 if (pastCircleCounter > pastCircles.count / 2) {97 if (pastCircleCounter > pastCircles.count / 2) {
90 var nextCircle = presentCircles.itemAt(presentCircleCounter++)98 var nextCircle = presentCircles.itemAt(presentCircleCounter++)
91 if (nextCircle !== null) nextCircle.presentCircleGrowAnim.start()99 if (nextCircle !== null) nextCircle.presentCircleChangeAnim.start()
92 }100 }
93 if (presentCircleCounter > infographic.model.currentDay && pastCircleCounter >= pastCircles.count) {101 if (presentCircleCounter > infographic.model.currentDay && pastCircleCounter >= pastCircles.count) {
94 stop()102 stop()
@@ -96,39 +104,8 @@
96 }104 }
97105
98 function startFromBeginning() {106 function startFromBeginning() {
99 circleGrowAnimTimer.pastCircleCounter = 0107 circleChangeAnimTimer.pastCircleCounter = 0
100 circleGrowAnimTimer.presentCircleCounter = 0108 circleChangeAnimTimer.presentCircleCounter = 0
101 start()
102 }
103 }
104
105 Timer {
106 id: circleShrinkAnimTimer
107
108 property int pastCircleCounter
109 property int presentCircleCounter
110
111 interval: animDuration
112 running: false
113 repeat: true
114 onTriggered: {
115 if (pastCircleCounter >= 0) {
116 var nextCircle = pastCircles.itemAt(pastCircleCounter--)
117 if (nextCircle !== null) nextCircle.pastCircleShrinkAnim.start()
118 }
119 if (pastCircleCounter < pastCircles.count / 2) {
120 var nextCircle = presentCircles.itemAt(presentCircleCounter--)
121 if (nextCircle !== null) nextCircle.presentCircleShrinkAnim.start()
122 }
123 if (presentCircleCounter < 0) {
124 stop()
125 infographic.model.readyForDataChange()
126 }
127 }
128
129 function startFromBeginning() {
130 pastCircleCounter = pastCircles.count - 1
131 presentCircleCounter = model.currentDay
132 start()109 start()
133 }110 }
134 }111 }
@@ -139,8 +116,7 @@
139 model: infographic.model.secondMonth116 model: infographic.model.secondMonth
140117
141 delegate: ObjectPositioner {118 delegate: ObjectPositioner {
142 property alias pastCircleGrowAnim: pastCircleGrowAnim119 property alias pastCircleChangeAnim: pastCircleChangeAnim
143 property alias pastCircleShrinkAnim: pastCircleShrinkAnim
144120
145 index: model.index121 index: model.index
146 count: pastCircles.count122 count: pastCircles.count
@@ -160,52 +136,33 @@
160 opacity: 0.0136 opacity: 0.0
161 scale: 0.0137 scale: 0.0
162 visible: modelData !== undefined138 visible: modelData !== undefined
163 color: Gradient.threeColorByIndex(index, count, infographic.model.secondColor)139 color: "transparent"
164140
165 SequentialAnimation {141 SequentialAnimation {
166 id: pastCircleGrowAnim142 id: pastCircleChangeAnim
167143
168 loops: 1144 loops: 1
169 ParallelAnimation {145 ParallelAnimation {
170 PropertyAnimation {146 PropertyAnimation {
171 target: pastCircle147 target: pastCircle
172 property: "opacity"148 property: "opacity"
173 from: 0.0
174 to: pastCircle.circleOpacity149 to: pastCircle.circleOpacity
175 easing.type: Easing.OutCurve150 easing.type: Easing.OutCurve
176 duration: circleGrowAnimTimer.interval * 4151 duration: circleChangeAnimTimer.interval * __circleModifier
177 }152 }
178 PropertyAnimation {153 PropertyAnimation {
179 target: pastCircle154 target: pastCircle
180 property: "scale"155 property: "scale"
181 from: 0.0
182 to: modelData156 to: modelData
183 easing.type: Easing.OutCurve157 easing.type: Easing.OutCurve
184 duration: circleGrowAnimTimer.interval * 4158 duration: circleChangeAnimTimer.interval * __circleModifier
185 }159 }
186 }160 ColorAnimation {
187 }161 target: pastCircle
188162 property: "color"
189 SequentialAnimation {163 to: Gradient.threeColorByIndex(index, count, infographic.model.secondColor)
190 id: pastCircleShrinkAnim164 easing.type: Easing.OutCurve
191165 duration: circleChangeAnimTimer.interval * __circleModifier
192 loops: 1
193 ParallelAnimation {
194 PropertyAnimation {
195 target: pastCircle
196 property: "opacity"
197 from: pastCircle.circleOpacity
198 to: 0.0
199 easing.type: Easing.OutCurve
200 duration: circleShrinkAnimTimer.interval * 4
201 }
202 PropertyAnimation {
203 target: pastCircle
204 property: "scale"
205 from: modelData
206 to: 0.0
207 easing.type: Easing.OutCurve
208 duration: circleShrinkAnimTimer.interval * 4
209 }166 }
210 }167 }
211 }168 }
@@ -219,8 +176,7 @@
219 model: infographic.model.firstMonth176 model: infographic.model.firstMonth
220177
221 delegate: ObjectPositioner {178 delegate: ObjectPositioner {
222 property alias presentCircleGrowAnim: presentCircleGrowAnim179 property alias presentCircleChangeAnim: presentCircleChangeAnim
223 property alias presentCircleShrinkAnim: presentCircleShrinkAnim
224180
225 index: model.index181 index: model.index
226 count: presentCircles.count182 count: presentCircles.count
@@ -240,10 +196,10 @@
240 opacity: 0.0196 opacity: 0.0
241 scale: 0.0197 scale: 0.0
242 visible: modelData !== undefined198 visible: modelData !== undefined
243 color: Gradient.threeColorByIndex(index, infographic.model.currentDay, infographic.model.firstColor)199 color: "transparent"
244200
245 SequentialAnimation {201 SequentialAnimation {
246 id: presentCircleGrowAnim202 id: presentCircleChangeAnim
247203
248 loops: 1204 loops: 1
249205
@@ -253,36 +209,21 @@
253 property: "opacity"209 property: "opacity"
254 to: presentCircle.circleOpacity210 to: presentCircle.circleOpacity
255 easing.type: Easing.OutCurve211 easing.type: Easing.OutCurve
256 duration: circleGrowAnimTimer.interval * 4212 duration: circleChangeAnimTimer.interval * __circleModifier
257 }213 }
258 PropertyAnimation {214 PropertyAnimation {
259 target: presentCircle215 target: presentCircle
260 property: "scale"216 property: "scale"
261 to: modelData217 to: modelData
262 easing.type: Easing.OutCurve218 easing.type: Easing.OutCurve
263 duration: circleGrowAnimTimer.interval * 4219 duration: circleChangeAnimTimer.interval * __circleModifier
264 }220 }
265 }221 ColorAnimation {
266 }222 target: presentCircle
267223 property: "color"
268 SequentialAnimation {224 to: Gradient.threeColorByIndex(index, infographic.model.currentDay, infographic.model.firstColor)
269 id: presentCircleShrinkAnim225 easing.type: Easing.OutCurve
270226 duration: circleChangeAnimTimer.interval * __circleModifier
271 loops: 1
272 ParallelAnimation {
273 PropertyAnimation {
274 target: presentCircle
275 property: "opacity"
276 to: 0.0
277 easing.type: Easing.OutCurve
278 duration: circleShrinkAnimTimer.interval * 4
279 }
280 PropertyAnimation {
281 target: presentCircle
282 property: "scale"
283 to: 0.0
284 easing.type: Easing.OutCurve
285 duration: circleShrinkAnimTimer.interval * 4
286 }227 }
287 }228 }
288 }229 }
@@ -313,7 +254,7 @@
313 stop()254 stop()
314 }255 }
315 if (dotCounter == Math.round(dots.count / 2)) {256 if (dotCounter == Math.round(dots.count / 2)) {
316 circleGrowAnimTimer.startFromBeginning()257 circleChangeAnimTimer.startFromBeginning()
317 }258 }
318 }259 }
319260
@@ -340,8 +281,8 @@
340 } else {281 } else {
341 stop()282 stop()
342 }283 }
343 if (dotCounter == Math.round(dots.count / 2)) {284 if (dotCounter == 0) {
344 circleShrinkAnimTimer.startFromBeginning()285 infographic.model.readyForDataChange()
345 }286 }
346 }287 }
347288
@@ -413,6 +354,7 @@
413 property alias showAnim: increaseOpacity354 property alias showAnim: increaseOpacity
414355
415 property real baseOpacity: 0.6356 property real baseOpacity: 0.6
357 property real duration: dotShowAnimTimer.interval * 5
416358
417 height: 0.7 * backgroundCircle.width359 height: 0.7 * backgroundCircle.width
418 width: notification.height360 width: notification.height
@@ -432,7 +374,7 @@
432 property: "opacity"374 property: "opacity"
433 from: 0.0375 from: 0.0
434 to: notification.baseOpacity376 to: notification.baseOpacity
435 duration: dotShowAnimTimer.interval * dots.count * 5377 duration: notification.duration * dots.count
436 }378 }
437379
438 PropertyAnimation {380 PropertyAnimation {
@@ -442,7 +384,8 @@
442 property: "opacity"384 property: "opacity"
443 from: notification.baseOpacity385 from: notification.baseOpacity
444 to: 0.0386 to: 0.0
445 duration: dotShowAnimTimer.interval * dots.count * 5387 duration: notification.duration * dots.count
388 onStopped: if (!__useDotAnimation) infographic.model.readyForDataChange()
446 }389 }
447 }390 }
448 }391 }
@@ -453,9 +396,10 @@
453 onDoubleClicked: {396 onDoubleClicked: {
454 if (!dotHideAnimTimer.running &&397 if (!dotHideAnimTimer.running &&
455 !dotShowAnimTimer.running &&398 !dotShowAnimTimer.running &&
456 !circleShrinkAnimTimer.running &&399 !circleChangeAnimTimer.running) {
457 !circleGrowAnimTimer.running)400 __useDotAnimation = false
458 infographic.model.nextDataSource()401 infographic.model.nextDataSource()
402 }
459 }403 }
460404
461 onClicked: mouse.accepted = false405 onClicked: mouse.accepted = false
462406
=== modified file 'qml/Shell.qml'
--- qml/Shell.qml 2014-08-06 19:39:07 +0000
+++ qml/Shell.qml 2014-08-12 11:40:17 +0000
@@ -48,6 +48,8 @@
48 property url background48 property url background
49 readonly property real panelHeight: panel.panelHeight49 readonly property real panelHeight: panel.panelHeight
5050
51 readonly property bool locked: LightDM.Greeter.active && !LightDM.Greeter.authenticated
52
51 property bool sideStageEnabled: shell.width >= units.gu(100)53 property bool sideStageEnabled: shell.width >= units.gu(100)
52 readonly property string focusedApplicationId: ApplicationManager.focusedApplicationId54 readonly property string focusedApplicationId: ApplicationManager.focusedApplicationId
5355
@@ -323,6 +325,7 @@
323 available: true325 available: true
324 hides: [launcher, panel.indicators]326 hides: [launcher, panel.indicators]
325 shown: true327 shown: true
328 loadContent: required || lockscreen.required // keeps content in memory for quick show()
326329
327 defaultBackground: shell.background330 defaultBackground: shell.background
328331
@@ -412,7 +415,7 @@
412 }415 }
413416
414 function showDash() {417 function showDash() {
415 if (LightDM.Greeter.active && !LightDM.Greeter.promptless) {418 if (shell.locked) {
416 return;419 return;
417 }420 }
418 if (greeter.shown) {421 if (greeter.shown) {
@@ -436,7 +439,7 @@
436 anchors.fill: parent //because this draws indicator menus439 anchors.fill: parent //because this draws indicator menus
437 indicators {440 indicators {
438 hides: [launcher]441 hides: [launcher]
439 available: edgeDemo.panelEnabled && greeter.fakeActiveForApp === ""442 available: edgeDemo.panelEnabled && !shell.locked
440 contentEnabled: edgeDemo.panelContentEnabled443 contentEnabled: edgeDemo.panelContentEnabled
441 width: parent.width > units.gu(60) ? units.gu(40) : parent.width444 width: parent.width > units.gu(60) ? units.gu(40) : parent.width
442 panelHeight: units.gu(3)445 panelHeight: units.gu(3)
@@ -460,7 +463,7 @@
460 anchors.bottom: parent.bottom463 anchors.bottom: parent.bottom
461 width: parent.width464 width: parent.width
462 dragAreaWidth: shell.edgeSize465 dragAreaWidth: shell.edgeSize
463 available: edgeDemo.launcherEnabled && greeter.fakeActiveForApp === ""466 available: edgeDemo.launcherEnabled && !shell.locked
464467
465 onShowDashHome: showHome()468 onShowDashHome: showHome()
466 onDash: showDash()469 onDash: showDash()
467470
=== modified file 'tests/autopilot/unity8/shell/emulators/greeter.py'
--- tests/autopilot/unity8/shell/emulators/greeter.py 2014-07-30 18:22:44 +0000
+++ tests/autopilot/unity8/shell/emulators/greeter.py 2014-08-12 11:40:17 +0000
@@ -28,6 +28,7 @@
28 def swipe(self):28 def swipe(self):
29 """Swipe the greeter screen away."""29 """Swipe the greeter screen away."""
30 self.created.wait_for(True)30 self.created.wait_for(True)
31 self.showProgress.wait_for(1)
3132
32 rect = self.globalRect33 rect = self.globalRect
33 start_x = rect[0] + rect[2] - 334 start_x = rect[0] + rect[2] - 3
@@ -36,7 +37,7 @@
36 stop_y = start_y37 stop_y = start_y
37 self.pointing_device.drag(start_x, start_y, stop_x, stop_y)38 self.pointing_device.drag(start_x, start_y, stop_x, stop_y)
3839
39 self.created.wait_for(False)40 self.showProgress.wait_for(0)
4041
41 def get_prompt(self):42 def get_prompt(self):
42 return self.select_single(43 return self.select_single(
4344
=== modified file 'tests/qmltests/tst_ShellWithPin.qml'
--- tests/qmltests/tst_ShellWithPin.qml 2014-07-29 11:35:10 +0000
+++ tests/qmltests/tst_ShellWithPin.qml 2014-08-12 11:40:17 +0000
@@ -116,6 +116,14 @@
116 tryCompare(sessionSpy, "count", 1)116 tryCompare(sessionSpy, "count", 1)
117 }117 }
118118
119 function test_disabledEdges() {
120 var launcher = findChild(shell, "launcher")
121 tryCompare(launcher, "available", false)
122
123 var indicators = findChild(shell, "indicators")
124 tryCompare(indicators, "available", false)
125 }
126
119 function test_emergencyCall() {127 function test_emergencyCall() {
120 var greeter = findChild(shell, "greeter")128 var greeter = findChild(shell, "greeter")
121 var lockscreen = findChild(shell, "lockscreen")129 var lockscreen = findChild(shell, "lockscreen")
@@ -130,10 +138,13 @@
130 tryCompare(greeter, "fakeActiveForApp", "dialer-app")138 tryCompare(greeter, "fakeActiveForApp", "dialer-app")
131 tryCompare(lockscreen, "shown", false)139 tryCompare(lockscreen, "shown", false)
132 tryCompare(panel, "fullscreenMode", true)140 tryCompare(panel, "fullscreenMode", true)
133 tryCompare(indicators, "available", false)
134 tryCompare(launcher, "available", false)
135 tryCompare(stage, "spreadEnabled", false)141 tryCompare(stage, "spreadEnabled", false)
136142
143 // These are normally false anyway, but confirm they remain so in
144 // emergency mode.
145 tryCompare(launcher, "available", false)
146 tryCompare(indicators, "available", false)
147
137 // Cancel emergency mode, and go back to normal148 // Cancel emergency mode, and go back to normal
138 waitForRendering(greeter)149 waitForRendering(greeter)
139 LightDM.Greeter.showGreeter()150 LightDM.Greeter.showGreeter()
@@ -142,8 +153,6 @@
142 tryCompare(greeter, "fakeActiveForApp", "")153 tryCompare(greeter, "fakeActiveForApp", "")
143 tryCompare(lockscreen, "shown", true)154 tryCompare(lockscreen, "shown", true)
144 tryCompare(panel, "fullscreenMode", false)155 tryCompare(panel, "fullscreenMode", false)
145 tryCompare(indicators, "available", true)
146 tryCompare(launcher, "available", true)
147 tryCompare(stage, "spreadEnabled", true)156 tryCompare(stage, "spreadEnabled", true)
148 }157 }
149158

Subscribers

People subscribed via source and target branches

to all changes: