Merge lp:~mterry/unity8/tutorial-launcher-gap into lp:unity8

Proposed by Michael Terry on 2015-05-14
Status: Rejected
Rejected by: Daniel d'Andrada on 2015-06-17
Proposed branch: lp:~mterry/unity8/tutorial-launcher-gap
Merge into: lp:unity8
Diff against target: 97 lines (+46/-7)
2 files modified
qml/Tutorial/TutorialLeft.qml (+15/-6)
tests/qmltests/Tutorial/tst_Tutorial.qml (+31/-1)
To merge this branch: bzr merge lp:~mterry/unity8/tutorial-launcher-gap
Reviewer Review Type Date Requested Status
Daniel d'Andrada (community) 2015-05-14 Disapprove on 2015-06-17
PS Jenkins bot continuous-integration Needs Fixing on 2015-06-16
Michael Zanetti (community) Needs Fixing on 2015-06-16
Review via email: mp+259127@code.launchpad.net

Commit Message

Make sure the tutorial doesn't let the user drag the launcher past the edge of the screen.

This was because the bouncing animation on the left added a bit of extra offset to the launcher. So I just made sure that offset doesn't go past the screen edge as the user drags the launcher out.

And added a test.

Description of the Change

Make sure the tutorial doesn't let the user drag the launcher past the edge of the screen.

This was because the bouncing animation on the left added a bit of extra offset to the launcher. So I just made sure that offset doesn't go past the screen edge as the user drags the launcher out.

And added a test.

== Checklist ==

 * 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

 * Did you make sure that your branch does not contain spurious tags?
 Yes

 * If you changed the packaging (debian), did you subscribe the ubuntu-unity team to this MP?
 NA

 * If you changed the UI, has there been a design review?
 NA

To post a comment you must log in.
Daniel d'Andrada (dandrader) wrote :

Could you please update the copyright year of qml/Tutorial/TutorialLeft.qml and tests/qmltests/Tutorial/tst_Tutorial.qml?

Daniel d'Andrada (dandrader) wrote :

* 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.
Only the usual autopilot failures

* Did you make sure that the branch does not contain spurious tags?
Yes

review: Approve
Michael Terry (mterry) wrote :

Updated copyrights

Michael Zanetti (mzanetti) wrote :

This introduces a bug: http://i.imgur.com/BNbcjvc.jpg

If you drag the launcher in the tutorial while it is bouncing, it won't return to be fully hidden any more afterwards.

review: Needs Fixing
Daniel d'Andrada (dandrader) wrote :

> This introduces a bug: http://i.imgur.com/BNbcjvc.jpg
>
> If you drag the launcher in the tutorial while it is bouncing, it won't return
> to be fully hidden any more afterwards.

Got a fix for this in lp:~dandrader/unity8/tutorial-launcher-gap

Now I just have to investigate two failures (unrelated to the fix) in "make testTutorial".

Unmerged revisions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'qml/Tutorial/TutorialLeft.qml'
2--- qml/Tutorial/TutorialLeft.qml 2015-01-09 17:58:05 +0000
3+++ qml/Tutorial/TutorialLeft.qml 2015-05-14 20:42:26 +0000
4@@ -1,5 +1,5 @@
5 /*
6- * Copyright (C) 2014 Canonical, Ltd.
7+ * Copyright (C) 2014,2015 Canonical, Ltd.
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11@@ -46,24 +46,33 @@
12
13 SequentialAnimation {
14 id: teaseAnimation
15+ objectName: "teaseAnimation"
16 paused: running && root.paused
17 running: !slider.active && root.launcher.visibleWidth === 0 && root.shown
18 loops: Animation.Infinite
19+ property real bounce: 0
20+ readonly property real maxBounce: units.gu(2)
21
22 UbuntuNumberAnimation {
23- target: root.launcher
24- property: "x"
25- to: units.gu(2)
26+ target: teaseAnimation
27+ property: "bounce"
28+ to: teaseAnimation.maxBounce
29 duration: UbuntuAnimation.SleepyDuration
30 }
31 UbuntuNumberAnimation {
32- target: root.launcher
33- property: "x"
34+ target: teaseAnimation
35+ property: "bounce"
36 to: 0
37 duration: UbuntuAnimation.SleepyDuration
38 }
39 }
40
41+ Binding {
42+ target: root.launcher
43+ property: "x"
44+ value: Math.min(root.launcher.panelWidth - root.launcher.visibleWidth, teaseAnimation.bounce)
45+ }
46+
47 Timer {
48 id: finishTimer
49 interval: 1
50
51=== modified file 'tests/qmltests/Tutorial/tst_Tutorial.qml'
52--- tests/qmltests/Tutorial/tst_Tutorial.qml 2015-05-05 14:46:11 +0000
53+++ tests/qmltests/Tutorial/tst_Tutorial.qml 2015-05-14 20:42:26 +0000
54@@ -1,5 +1,5 @@
55 /*
56- * Copyright (C) 2013,2014 Canonical, Ltd.
57+ * Copyright (C) 2013,2014,2015 Canonical, Ltd.
58 *
59 * This program is free software; you can redistribute it and/or modify
60 * it under the terms of the GNU General Public License as published by
61@@ -325,6 +325,36 @@
62 tryCompare(left, "shown", true); // and we should still be on left
63 }
64
65+ function test_launcherNoDragGap() {
66+ // See bug 1454882, where if you dragged the launcher while it was
67+ // visible, you could pull it further than the edge of the screen.
68+
69+ var left = goToPage("tutorialLeft");
70+ var launcher = findChild(shell, "launcher");
71+ var teaseAnimation = findInvisibleChild(left, "teaseAnimation");
72+
73+ // Wait for launcher to be really out there
74+ tryCompareFunction(function() {return launcher.x > teaseAnimation.maxBounce/2}, true);
75+ verify(teaseAnimation.running);
76+
77+ // Start a drag, make sure animation stops
78+ touchFlick(shell, 0, halfHeight, units.gu(3), halfHeight, true, false);
79+ verify(!teaseAnimation.running);
80+ verify(launcher.visibleWidth > 0);
81+ verify(launcher.x > 0);
82+ compare(launcher.x, teaseAnimation.bounce);
83+
84+ // Continue drag, make sure we don't create a gap on the left hand side
85+ touchFlick(shell, units.gu(3), halfHeight, shell.width, halfHeight, false, false);
86+ verify(!teaseAnimation.running);
87+ compare(launcher.visibleWidth, launcher.panelWidth);
88+ compare(launcher.x, 0);
89+
90+ // Finish and make sure we continue animation
91+ touchFlick(shell, shell.width, halfHeight, shell.width, halfHeight, false, true);
92+ tryCompare(teaseAnimation, "running", true);
93+ }
94+
95 function test_spread() {
96 // Unfortunately, most of what we want to test of the spread is
97 // "did it render correctly?" but that's hard to test. So instead,

Subscribers

People subscribed via source and target branches