Merge lp:~mzanetti/unity8/fix-appdelegate-jumping into lp:unity8

Proposed by Michael Zanetti
Status: Merged
Approved by: Michał Sawicz
Approved revision: 1440
Merged at revision: 1455
Proposed branch: lp:~mzanetti/unity8/fix-appdelegate-jumping
Merge into: lp:unity8
Diff against target: 48 lines (+17/-4)
2 files modified
qml/Stages/SpreadDelegate.qml (+13/-3)
tests/qmltests/Stages/tst_SpreadDelegate.qml (+4/-1)
To merge this branch: bzr merge lp:~mzanetti/unity8/fix-appdelegate-jumping
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Needs Fixing
Daniel d'Andrada (community) Abstain
Michał Sawicz Needs Fixing
Albert Astals Cid (community) Approve
Review via email: mp+241930@code.launchpad.net

Commit message

increase threshold and avoid jumping in SpreadDelegate dragging

Description of the change

 * 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?

n/a

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

fixing bugs reported by design

To post a comment you must log in.
Revision history for this message
Albert Astals Cid (aacid) 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.
Waiting for it for top approval

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

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Albert Astals Cid (aacid) wrote :

qmluitest got broken by this.

review: Needs Fixing
Revision history for this message
Albert Astals Cid (aacid) :
review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Daniel d'Andrada (dandrader) wrote :

35 + verify(Math.abs(Math.abs(appWindowWithShadow.y) - dragDistance) == units.gu(2));

You should make the test access the threshold variable instead of duplicating its value here, which has the danger or getting out of sync. It would also hopefully make this expression more self-explanatory

review: Needs Fixing
Revision history for this message
Michał Sawicz (saviq) wrote :

This introduced jumping in the spread when dragging the app up'n'down and crossing the middle of the screen.

review: Needs Fixing
1439. By Michael Zanetti

fix jumping when changing swipe direction

Revision history for this message
Michael Zanetti (mzanetti) wrote :

> 35 + verify(Math.abs(Math.abs(appWindowWithShadow.y) - dragDistance) ==
> units.gu(2));
>
> You should make the test access the threshold variable instead of duplicating
> its value here, which has the danger or getting out of sync. It would also
> hopefully make this expression more self-explanatory

fixed

Revision history for this message
Michael Zanetti (mzanetti) wrote :

> This introduced jumping in the spread when dragging the app up'n'down and
> crossing the middle of the screen.

fixed

Revision history for this message
Daniel d'Andrada (dandrader) wrote :

> > 35 + verify(Math.abs(Math.abs(appWindowWithShadow.y) - dragDistance) ==
> > units.gu(2));
> >
> > You should make the test access the threshold variable instead of
> duplicating
> > its value here, which has the danger or getting out of sync. It would also
> > hopefully make this expression more self-explanatory
>
> fixed

Thanks!

review: Abstain
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
1440. By Michael Zanetti

verfiy -> compare

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'qml/Stages/SpreadDelegate.qml'
2--- qml/Stages/SpreadDelegate.qml 2014-09-19 11:20:07 +0000
3+++ qml/Stages/SpreadDelegate.qml 2014-11-24 10:27:18 +0000
4@@ -75,6 +75,8 @@
5
6 property bool moving: false
7 property real distance: 0
8+ readonly property int threshold: units.gu(2)
9+ property int offset: 0
10
11 readonly property real minSpeedToClose: units.gu(40)
12
13@@ -82,9 +84,17 @@
14 if (!dragging) {
15 return;
16 }
17- moving = moving || Math.abs(dragValue) > units.gu(1)
18- if (moving) {
19- distance = dragValue;
20+ moving = moving || Math.abs(dragValue) > threshold;
21+ if (moving) {
22+ distance = dragValue + offset;
23+ }
24+ }
25+
26+ onMovingChanged: {
27+ if (moving) {
28+ offset = (dragValue > 0 ? -threshold: threshold)
29+ } else {
30+ offset = 0;
31 }
32 }
33
34
35=== modified file 'tests/qmltests/Stages/tst_SpreadDelegate.qml'
36--- tests/qmltests/Stages/tst_SpreadDelegate.qml 2014-08-13 19:50:09 +0000
37+++ tests/qmltests/Stages/tst_SpreadDelegate.qml 2014-11-24 10:27:18 +0000
38@@ -137,7 +137,10 @@
39
40 if (data.swipeToClose) {
41 verify(appWindowWithShadow.y < 0);
42- verify(Math.abs(Math.abs(appWindowWithShadow.y) - dragDistance) < units.gu(1));
43+ var threshold = findChild(spreadDelegateLoader.item, "dragArea").threshold
44+ // Verify that the delegate started moving exactly "threshold" after the finger movement
45+ // and did not jump up to the finger, but lags the threshold behind
46+ compare(Math.abs(Math.abs(appWindowWithShadow.y) - dragDistance), threshold);
47
48 touchRelease(spreadDelegateLoader.item, touchX, toY - units.gu(1));
49

Subscribers

People subscribed via source and target branches