on xenial help sign in
some small tweaks and make more tests pass
ef23f09Michael Zanetti
qml/Shell.qml+3−9
@@ -161,13 +161,7 @@ FocusScope {
161
161
162 contentScale: 1.0 - 0.2 * disappearingAnimationProgress
162 contentScale: 1.0 - 0.2 * disappearingAnimationProgress
163 opacity: 1.0 - disappearingAnimationProgress
163 opacity: 1.0 - disappearingAnimationProgress
164− property real disappearingAnimationProgress: {
164+ property real disappearingAnimationProgress: greeter.shown ? greeter.showProgress : stages.showProgress
165− if (greeter.shown) {
166− return greeter.showProgress;
167− } else {
168− return stages.showProgress;
169− }
170− }
171
165
172 // FIXME: only necessary because stages.showProgress and
166 // FIXME: only necessary because stages.showProgress and
173 // greeterRevealer.animatedProgress are not animated
167 // greeterRevealer.animatedProgress are not animated
@@ -187,9 +181,9 @@ FocusScope {
187 onTouchXChanged: {
181 onTouchXChanged: {
188 if (status == DirectionalDragArea.Recognized) {
182 if (status == DirectionalDragArea.Recognized) {
189 if (ApplicationManager.count == 0) {
183 if (ApplicationManager.count == 0) {
190− progress = Math.max(stages.width + touchX * 2, stages.width * .7)
184+ progress = Math.max(stages.width - stagesDragHandle.width + touchX, stages.width * .3)
191 } else {
185 } else {
192− progress = stages.width + touchX
186+ progress = stages.width - stagesDragHandle.width + touchX
193 }
187 }
194 }
188 }
195 }
189 }
qml/Stages/TransformedSpreadDelegate.qml+3−1
@@ -104,6 +104,8 @@ SpreadDelegate {
104 return helperEasingCurve.value * (endValue - startValue) + startValue;
104 return helperEasingCurve.value * (endValue - startValue) + startValue;
105 }
105 }
106
106
107+ property real animatedEndDistance: linearAnimation(0, 2, root.endDistance, 0, root.progress)
108+
107 property real xTranslate: {
109 property real xTranslate: {
108 if (otherSelected) {
110 if (otherSelected) {
109 if (spreadView.stage < 2 && index == 0) {
111 if (spreadView.stage < 2 && index == 0) {
@@ -144,7 +146,7 @@ SpreadDelegate {
144 // Fix it at the right edge...
146 // Fix it at the right edge...
145 var rightEdgeOffset = -((index - 1) * root.startDistance)
147 var rightEdgeOffset = -((index - 1) * root.startDistance)
146 // ...and use our easing to move them to the left. Stop a bit earlier for each tile
148 // ...and use our easing to move them to the left. Stop a bit earlier for each tile
147− return -easingCurve.value * spreadView.width + (index * root.endDistance) + rightEdgeOffset
149+ return -easingCurve.value * spreadView.width + (index * animatedEndDistance) + rightEdgeOffset
148
150
149 }
151 }
150
152
tests/qmltests/tst_Shell.qml+2−26
@@ -103,12 +103,8 @@ Item {
103 swipeAwayGreeter();
103 swipeAwayGreeter();
104 }
104 }
105
105
106− print("killing apps in 5 secs")
107− wait(1000)
108 // kill all (fake) running apps
106 // kill all (fake) running apps
109 killApps(ApplicationManager);
107 killApps(ApplicationManager);
110− print("killed apps")
111− wait(1000)
112
108
113 var dashHome = findChild(shell, "DashHome");
109 var dashHome = findChild(shell, "DashHome");
114 swipeUntilScopeViewIsReached(dashHome);
110 swipeUntilScopeViewIsReached(dashHome);
@@ -187,34 +183,28 @@ Item {
187 function test_suspend() {
183 function test_suspend() {
188 var greeter = findChild(shell, "greeter");
184 var greeter = findChild(shell, "greeter");
189
185
190− print("step1")
191 // Launch an app from the launcher
186 // Launch an app from the launcher
192 dragLauncherIntoView();
187 dragLauncherIntoView();
193 tapOnAppIconInLauncher();
188 tapOnAppIconInLauncher();
194 waitUntilApplicationWindowIsFullyVisible();
189 waitUntilApplicationWindowIsFullyVisible();
195
190
196− print("step2")
197 var mainApp = ApplicationManager.focusedApplicationId;
191 var mainApp = ApplicationManager.focusedApplicationId;
198 verify(mainApp != "");
192 verify(mainApp != "");
199
193
200− print("step3")
201 // Try to suspend while proximity is engaged...
194 // Try to suspend while proximity is engaged...
202 Powerd.displayPowerStateChange(Powerd.Off, Powerd.UseProximity);
195 Powerd.displayPowerStateChange(Powerd.Off, Powerd.UseProximity);
203 tryCompare(greeter, "showProgress", 0);
196 tryCompare(greeter, "showProgress", 0);
204
197
205− print("step4")
206 // Now really suspend
198 // Now really suspend
207 Powerd.displayPowerStateChange(Powerd.Off, 0);
199 Powerd.displayPowerStateChange(Powerd.Off, 0);
208 tryCompare(greeter, "showProgress", 1);
200 tryCompare(greeter, "showProgress", 1);
209 tryCompare(ApplicationManager, "focusedApplicationId", "");
201 tryCompare(ApplicationManager, "focusedApplicationId", "");
210
202
211− print("step5")
212 // And wake up
203 // And wake up
213 Powerd.displayPowerStateChange(Powerd.On, 0);
204 Powerd.displayPowerStateChange(Powerd.On, 0);
214 tryCompare(ApplicationManager, "focusedApplicationId", "");
205 tryCompare(ApplicationManager, "focusedApplicationId", "");
215 tryCompare(greeter, "showProgress", 1);
206 tryCompare(greeter, "showProgress", 1);
216
207
217− print("step6")
218 // Swipe away greeter to focus app
208 // Swipe away greeter to focus app
219 swipeAwayGreeter();
209 swipeAwayGreeter();
220 tryCompare(ApplicationManager, "focusedApplicationId", mainApp);
210 tryCompare(ApplicationManager, "focusedApplicationId", mainApp);
@@ -250,7 +240,7 @@ Item {
250 tryCompare(dash.opacity, 1.0);
240 tryCompare(dash.opacity, 1.0);
251
241
252 touchFlick(shell, touchX, touchY, shell.width * 0.1, touchY,
242 touchFlick(shell, touchX, touchY, shell.width * 0.1, touchY,
253− true /* beginTouch */, false /* endTouch */);
243+ true /* beginTouch */, false /* endTouch */, units.gu(10), 50);
254
244
255 // check that Dash has been scaled down and had its opacity reduced
245 // check that Dash has been scaled down and had its opacity reduced
256 tryCompareFunction(function() { return dash.contentScale <= 0.9; }, true);
246 tryCompareFunction(function() { return dash.contentScale <= 0.9; }, true);
@@ -281,7 +271,7 @@ Item {
281 tryCompare(dash, "opacity", 1.0);
271 tryCompare(dash, "opacity", 1.0);
282
272
283 touchFlick(shell, touchX, touchY, shell.width * 0.1, touchY,
273 touchFlick(shell, touchX, touchY, shell.width * 0.1, touchY,
284− true /* beginTouch */, false /* endTouch */);
274+ true /* beginTouch */, false /* endTouch */, units.gu(10), 50);
285
275
286 // check that Dash has been scaled down and had its opacity reduced
276 // check that Dash has been scaled down and had its opacity reduced
287 tryCompareFunction(function() { return dash.contentScale <= 0.9; }, true);
277 tryCompareFunction(function() { return dash.contentScale <= 0.9; }, true);
@@ -513,10 +503,6 @@ Item {
513 }
503 }
514
504
515 function test_DashShown(data) {
505 function test_DashShown(data) {
516−
517− print("step1")
518−// wait(1000)
519− // greeter: false,
520 if (data.greeter) {
506 if (data.greeter) {
521 // Swipe the greeter in
507 // Swipe the greeter in
522 var greeter = findChild(shell, "greeter");
508 var greeter = findChild(shell, "greeter");
@@ -524,31 +510,21 @@ Item {
524 tryCompare(greeter, "showProgress", 1);
510 tryCompare(greeter, "showProgress", 1);
525 }
511 }
526
512
527− print("step2")
528− //app: false,
529 if (data.app) {
513 if (data.app) {
530 dragLauncherIntoView();
514 dragLauncherIntoView();
531 tapOnAppIconInLauncher();
515 tapOnAppIconInLauncher();
532 }
516 }
533
517
534− print("step3")
535− // launcher: true,
536 if (data.launcher) {
518 if (data.launcher) {
537 dragLauncherIntoView();
519 dragLauncherIntoView();
538 }
520 }
539
521
540− print("step4")
541− // indicators: false,
542 if (data.indicators) {
522 if (data.indicators) {
543 showIndicators();
523 showIndicators();
544 }
524 }
545
525
546− print("step5")
547− //expectedShown: true},
548 var dash = findChild(shell, "dash");
526 var dash = findChild(shell, "dash");
549− print("step6", dash, dash.shown, data.expectedShown)
550 tryCompare(dash, "shown", data.expectedShown);
527 tryCompare(dash, "shown", data.expectedShown);
551− print("step7")
552 }
528 }
553
529
554 function test_searchIndicatorHidesOnAppFocus() {
530 function test_searchIndicatorHidesOnAppFocus() {