on xenial help sign in
some small tweaks and make more tests pass
commitef23f09f7a4b958a0636257d84c63e8421db2d9b authorMichael Zanetti <michael.zanetti@canonical.com> dateThu 6 Feb 2014, 13:21 (13 years ago) parent9ddec94
3 files changed+8−36
qml/Shell.qml+3−9 qml/Stages/TransformedSpreadDelegate.qml+3−1 tests/qmltests/tst_Shell.qml+2−26
qml/Shell.qml+3−9
@@ -161,13 +161,7 @@ FocusScope {
161161
162162 contentScale: 1.0 - 0.2 * disappearingAnimationProgress
163163 opacity: 1.0 - disappearingAnimationProgress
164− property real disappearingAnimationProgress: {
165− if (greeter.shown) {
166− return greeter.showProgress;
167− } else {
168− return stages.showProgress;
169− }
170− }
164+ property real disappearingAnimationProgress: greeter.shown ? greeter.showProgress : stages.showProgress
171165
172166 // FIXME: only necessary because stages.showProgress and
173167 // greeterRevealer.animatedProgress are not animated
@@ -187,9 +181,9 @@ FocusScope {
187181 onTouchXChanged: {
188182 if (status == DirectionalDragArea.Recognized) {
189183 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)
191185 } else {
192− progress = stages.width + touchX
186+ progress = stages.width - stagesDragHandle.width + touchX
193187 }
194188 }
195189 }
qml/Stages/TransformedSpreadDelegate.qml+3−1
@@ -104,6 +104,8 @@ SpreadDelegate {
104104 return helperEasingCurve.value * (endValue - startValue) + startValue;
105105 }
106106
107+ property real animatedEndDistance: linearAnimation(0, 2, root.endDistance, 0, root.progress)
108+
107109 property real xTranslate: {
108110 if (otherSelected) {
109111 if (spreadView.stage < 2 && index == 0) {
@@ -144,7 +146,7 @@ SpreadDelegate {
144146 // Fix it at the right edge...
145147 var rightEdgeOffset = -((index - 1) * root.startDistance)
146148 // ...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
148150
149151 }
150152
tests/qmltests/tst_Shell.qml+2−26
@@ -103,12 +103,8 @@ Item {
103103 swipeAwayGreeter();
104104 }
105105
106− print("killing apps in 5 secs")
107− wait(1000)
108106 // kill all (fake) running apps
109107 killApps(ApplicationManager);
110− print("killed apps")
111− wait(1000)
112108
113109 var dashHome = findChild(shell, "DashHome");
114110 swipeUntilScopeViewIsReached(dashHome);
@@ -187,34 +183,28 @@ Item {
187183 function test_suspend() {
188184 var greeter = findChild(shell, "greeter");
189185
190− print("step1")
191186 // Launch an app from the launcher
192187 dragLauncherIntoView();
193188 tapOnAppIconInLauncher();
194189 waitUntilApplicationWindowIsFullyVisible();
195190
196− print("step2")
197191 var mainApp = ApplicationManager.focusedApplicationId;
198192 verify(mainApp != "");
199193
200− print("step3")
201194 // Try to suspend while proximity is engaged...
202195 Powerd.displayPowerStateChange(Powerd.Off, Powerd.UseProximity);
203196 tryCompare(greeter, "showProgress", 0);
204197
205− print("step4")
206198 // Now really suspend
207199 Powerd.displayPowerStateChange(Powerd.Off, 0);
208200 tryCompare(greeter, "showProgress", 1);
209201 tryCompare(ApplicationManager, "focusedApplicationId", "");
210202
211− print("step5")
212203 // And wake up
213204 Powerd.displayPowerStateChange(Powerd.On, 0);
214205 tryCompare(ApplicationManager, "focusedApplicationId", "");
215206 tryCompare(greeter, "showProgress", 1);
216207
217− print("step6")
218208 // Swipe away greeter to focus app
219209 swipeAwayGreeter();
220210 tryCompare(ApplicationManager, "focusedApplicationId", mainApp);
@@ -250,7 +240,7 @@ Item {
250240 tryCompare(dash.opacity, 1.0);
251241
252242 touchFlick(shell, touchX, touchY, shell.width * 0.1, touchY,
253− true /* beginTouch */, false /* endTouch */);
243+ true /* beginTouch */, false /* endTouch */, units.gu(10), 50);
254244
255245 // check that Dash has been scaled down and had its opacity reduced
256246 tryCompareFunction(function() { return dash.contentScale <= 0.9; }, true);
@@ -281,7 +271,7 @@ Item {
281271 tryCompare(dash, "opacity", 1.0);
282272
283273 touchFlick(shell, touchX, touchY, shell.width * 0.1, touchY,
284− true /* beginTouch */, false /* endTouch */);
274+ true /* beginTouch */, false /* endTouch */, units.gu(10), 50);
285275
286276 // check that Dash has been scaled down and had its opacity reduced
287277 tryCompareFunction(function() { return dash.contentScale <= 0.9; }, true);
@@ -513,10 +503,6 @@ Item {
513503 }
514504
515505 function test_DashShown(data) {
516−
517− print("step1")
518−// wait(1000)
519− // greeter: false,
520506 if (data.greeter) {
521507 // Swipe the greeter in
522508 var greeter = findChild(shell, "greeter");
@@ -524,31 +510,21 @@ Item {
524510 tryCompare(greeter, "showProgress", 1);
525511 }
526512
527− print("step2")
528− //app: false,
529513 if (data.app) {
530514 dragLauncherIntoView();
531515 tapOnAppIconInLauncher();
532516 }
533517
534− print("step3")
535− // launcher: true,
536518 if (data.launcher) {
537519 dragLauncherIntoView();
538520 }
539521
540− print("step4")
541− // indicators: false,
542522 if (data.indicators) {
543523 showIndicators();
544524 }
545525
546− print("step5")
547− //expectedShown: true},
548526 var dash = findChild(shell, "dash");
549− print("step6", dash, dash.shown, data.expectedShown)
550527 tryCompare(dash, "shown", data.expectedShown);
551− print("step7")
552528 }
553529
554530 function test_searchIndicatorHidesOnAppFocus() {