Merge lp:~aacid/unity8/pan_regression into lp:unity8

Proposed by Albert Astals Cid on 2015-03-18
Status: Merged
Approved by: Andrea Cimitan on 2015-03-18
Approved revision: 1667
Merged at revision: 1693
Proposed branch: lp:~aacid/unity8/pan_regression
Merge into: lp:unity8
Diff against target: 73 lines (+22/-15)
3 files modified
qml/Components/ZoomableImage.qml (+14/-14)
tests/qmltests/Components/tst_ZoomableImage.qml (+7/-0)
tests/utils/modules/Unity/Test/UnityTestCase.qml (+1/-1)
To merge this branch: bzr merge lp:~aacid/unity8/pan_regression
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Needs Fixing on 2015-03-19
Andrea Cimitan (community) 2015-03-18 Approve on 2015-03-18
Review via email: mp+253375@code.launchpad.net

Commit Message

Fix regression making pan not possible in Zoomable Image

Qt never seems to send two presses standalone since that confuses code that still works on mouse events, the second one is always part of a move.
Also make the test check panning works so that it may be harder to regress again

Description of the Change

 * Are there any related MPs required for this MP to build/function as expected?
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?
N/A

To post a comment you must log in.
lp:~aacid/unity8/pan_regression updated on 2015-03-18
1667. By Albert Astals Cid on 2015-03-18

spacing

Andrea Cimitan (cimi) 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
 * Did you make sure that the branch does not contain spurious tags?
Yes

review: Approve
Andrea Cimitan (cimi) wrote :

unrelated failures

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'qml/Components/ZoomableImage.qml'
2--- qml/Components/ZoomableImage.qml 2015-02-20 11:54:34 +0000
3+++ qml/Components/ZoomableImage.qml 2015-03-18 14:41:30 +0000
4@@ -107,6 +107,20 @@
5 }
6 }
7
8+ PinchArea {
9+ id: pinchArea
10+ objectName: "pinchArea"
11+ property real minScale: 1.0
12+ anchors.fill: parent
13+ enabled: zoomable ? zoomable : false
14+
15+ pinch.target: image
16+ pinch.minimumScale: minScale
17+ pinch.maximumScale: 10
18+
19+ onPinchFinished: flickable.returnToBounds()
20+ }
21+
22 MouseArea {
23 id: mouseArea
24 objectName: "mouseArea"
25@@ -139,18 +153,4 @@
26 }
27 }
28 }
29-
30- PinchArea {
31- id: pinchArea
32- objectName: "pinchArea"
33- property real minScale: 1.0
34- anchors.fill: flickable
35- enabled: zoomable ? zoomable : false
36-
37- pinch.target: image
38- pinch.minimumScale: minScale
39- pinch.maximumScale: 10
40-
41- onPinchFinished: flickable.returnToBounds()
42- }
43 }
44
45=== modified file 'tests/qmltests/Components/tst_ZoomableImage.qml'
46--- tests/qmltests/Components/tst_ZoomableImage.qml 2014-10-21 21:16:36 +0000
47+++ tests/qmltests/Components/tst_ZoomableImage.qml 2015-03-18 14:41:30 +0000
48@@ -182,6 +182,13 @@
49 compare(flickable.contentWidth, Math.max(imageRenderer.width * image.scale, flickable.width));
50 compare(flickable.contentHeight, Math.max(imageRenderer.height * image.scale, flickable.height));
51
52+ // try pan it a bit
53+ var contentX = flickable.contentX;
54+ var contentY = flickable.contentY;
55+ touchFlick(zoomableImage, units.gu(1), units.gu(1), units.gu(10), units.gu(10));
56+ tryCompare(flickable, "moving", false)
57+ tryCompareFunction(function() { return flickable.contentX != contentX && flickable.contentY != contentY; }, zoomableImage.zoomable)
58+
59 wait(3000); // have to delay between two consequent pinch event.
60 // pinch zoom-out
61 touchPinch(zoomableImage, x1End, y1End, x1Start, y1Start, x2End, y2End, x2Start, y2Start);
62
63=== modified file 'tests/utils/modules/Unity/Test/UnityTestCase.qml'
64--- tests/utils/modules/Unity/Test/UnityTestCase.qml 2015-02-17 15:06:33 +0000
65+++ tests/utils/modules/Unity/Test/UnityTestCase.qml 2015-03-18 14:41:30 +0000
66@@ -292,7 +292,7 @@
67 event1.press(0, x1Start, y1Start);
68 event1.commit();
69 // second finger
70- event1.stationary(0);
71+ event1.move(0, x1Start, y1Start);
72 event1.press(1, x2Start, y2Start);
73 event1.commit();
74

Subscribers

People subscribed via source and target branches