Merge lp:~dandrader/unity8/DragHandleAllDirections into lp:unity8

Proposed by Daniel d'Andrada on 2016-05-18
Status: Merged
Approved by: Michael Terry on 2016-05-27
Approved revision: 2400
Merged at revision: 2411
Proposed branch: lp:~dandrader/unity8/DragHandleAllDirections
Merge into: lp:unity8
Prerequisite: lp:~aacid/unity8/nodda
Diff against target: 491 lines (+286/-33)
7 files modified
qml/Components/DragHandle.qml (+28/-8)
qml/Stages/SideStage.qml (+1/-2)
tests/qmltests/Components/tst_DragHandle.cpp (+7/-7)
tests/qmltests/Components/tst_DragHandle.qml (+27/-9)
tests/qmltests/Components/tst_DragHandle/BottomEdgeShowable.qml (+108/-0)
tests/qmltests/Components/tst_DragHandle/RightEdgeShowable.qml (+108/-0)
tests/qmltests/Components/tst_DragHandle/TopEdgeShowable.qml (+7/-7)
To merge this branch: bzr merge lp:~dandrader/unity8/DragHandleAllDirections
Reviewer Review Type Date Requested Status
Michael Terry Approve on 2016-05-27
Unity8 CI Bot continuous-integration 2016-05-18 Needs Fixing on 2016-05-18
Nick Dedekind 2016-05-18 Pending
Review via email: mp+295128@code.launchpad.net

This proposal supersedes a proposal from 2016-05-09.

Commit Message

Fix DragHandle so it works in all directions

And therefore we can remove the hack in SideStage

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

* 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.
Unity8 CI Bot (unity8-ci-bot) wrote : Posted in a previous version of this proposal

FAILED: Continuous integration, rev:2395
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/1157/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=vivid+overlay,testname=qmluitests.sh/709
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial+overlay,testname=qmluitests.sh/709
    FAILURE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=phone-armhf,release=vivid+overlay,testname=autopilot.sh/709/console
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/1550
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/1510
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial+overlay/1510
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/1510
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/1510/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/1510
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/1510/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/1510
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/1510/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/1510
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/1510/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/1510
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/1510/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/1510
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/1510/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/1157/rebuild

review: Needs Fixing (continuous-integration)
Nick Dedekind (nick-dedekind) wrote : Posted in a previous version of this proposal

Looks fine. Tested SideStage and test/tryDragHandle.

 * 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.
No; qmluitest failures. tried and they run on my machine. so seems unrelated.

review: Approve
Unity8 CI Bot (unity8-ci-bot) wrote :

FAILED: Continuous integration, rev:2400
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/1246/
Executed test runs:
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=vivid+overlay,testname=qmluitests.sh/782
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial+overlay,testname=qmluitests.sh/782
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/1680
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/1630
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial+overlay/1630
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/1623
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/1623/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/1623
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/1623/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/1623
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/1623/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/1623
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/1623/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/1623
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/1623/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/1623
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/1623/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/1246/rebuild

review: Needs Fixing (continuous-integration)
Michael Terry (mterry) wrote :

Carrying over previous approval.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'qml/Components/DragHandle.qml'
2--- qml/Components/DragHandle.qml 2016-05-18 21:31:43 +0000
3+++ qml/Components/DragHandle.qml 2016-05-18 21:31:43 +0000
4@@ -1,5 +1,5 @@
5 /*
6- * Copyright (C) 2013 Canonical, Ltd.
7+ * Copyright (C) 2013,2016 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@@ -70,15 +70,16 @@
12 property: "targetValue"
13 duration: 150
14 velocity: -1
15- to: Direction.isPositive(direction) ? d.startValue + hintDisplacement
16- : d.startValue - hintDisplacement
17+
18+ to: d.incrementTargetProp ? d.startValue + hintDisplacement
19+ : d.startValue - hintDisplacement
20 property real targetValue
21 onTargetValueChanged: {
22 if (!running) {
23 return;
24 }
25
26- if (Direction.isPositive(direction)) {
27+ if (d.incrementTargetProp) {
28 if (parent[d.targetProp] < targetValue) {
29 parent[d.targetProp] = targetValue;
30 }
31@@ -93,19 +94,24 @@
32 // Private stuff
33 QtObject {
34 id: d
35+
36+ // Whether movement along the designated direction will increment the value of the target property
37+ readonly property bool incrementTargetProp: (Direction.isPositive(direction) && !dragArea.stretch)
38+ || (dragArea.stretch && !d.dragParent.shown)
39+
40 property real startValue
41 property real minValue: {
42 if (direction == Direction.Horizontal) {
43 return startValue - maxTotalDragDistance;
44- } else if (Direction.isPositive(direction)) {
45+ } else if (incrementTargetProp) {
46 return startValue;
47 } else {
48 return startValue - maxTotalDragDistance;
49 }
50 }
51
52- property real maxValue: Direction.isPositive(direction) ? startValue + maxTotalDragDistance
53- : startValue
54+ property real maxValue: incrementTargetProp ? startValue + maxTotalDragDistance
55+ : startValue;
56
57 property var dragParent: dragArea.parent
58
59@@ -127,7 +133,7 @@
60 }
61
62 // we should not go behind hintingAnimation's current value
63- if (Direction.isPositive(direction)) {
64+ if (d.incrementTargetProp) {
65 if (d.startValue + diff < hintingAnimation.targetValue) {
66 diff = hintingAnimation.targetValue - d.startValue;
67 }
68@@ -180,6 +186,20 @@
69 if (dragging) {
70 if (!Direction.isPositive(direction))
71 distance = -distance;
72+
73+ if (dragArea.stretch &&
74+ ((!Direction.isPositive(direction) && !d.dragParent.shown)
75+ ||
76+ (Direction.isPositive(direction) && d.dragParent.shown))
77+ )
78+ {
79+ // This happens when you have a stretching showable being shown from the right or
80+ // top edge (and consequently being hidden when dragged towards the right/top edge)
81+ // In those situations, dimension expansion/retraction happens in the opposite
82+ // sign of the axis direction
83+ distance = -distance;
84+ }
85+
86 var toAdd = d.limitMovement(distance);
87 parent[d.targetProp] = d.startValue + toAdd;
88 }
89
90=== modified file 'qml/Stages/SideStage.qml'
91--- qml/Stages/SideStage.qml 2016-03-11 20:18:12 +0000
92+++ qml/Stages/SideStage.qml 2016-05-18 21:31:43 +0000
93@@ -98,8 +98,7 @@
94 id: hideSideStageDragArea
95 objectName: "hideSideStageDragArea"
96
97- direction: Direction.Leftwards
98- rotation: 180
99+ direction: Direction.Rightwards
100 enabled: root.shown
101 anchors.right: root.left
102 width: sideStageDragHandle.width
103
104=== modified file 'tests/qmltests/Components/tst_DragHandle.cpp'
105--- tests/qmltests/Components/tst_DragHandle.cpp 2016-05-18 21:31:43 +0000
106+++ tests/qmltests/Components/tst_DragHandle.cpp 2016-05-18 21:31:43 +0000
107@@ -1,5 +1,5 @@
108 /*
109- * Copyright (C) 2013-2014 Canonical, Ltd.
110+ * Copyright (C) 2013-2014,2016 Canonical, Ltd.
111 *
112 * This program is free software; you can redistribute it and/or modify
113 * it under the terms of the GNU General Public License as published by
114@@ -290,7 +290,7 @@
115 QQuickItem *baseItem = m_view->rootObject()->findChild<QQuickItem*>("baseItem");
116 baseItem->setRotation(rotation);
117
118- QQuickItem *dragHandle = fetchAndSetupDragHandle("downwardsDragHandle");
119+ QQuickItem *dragHandle = fetchAndSetupDragHandle("topEdgeShowDragHandle");
120
121 qreal dragThreshold = fetchDragThreshold(dragHandle);
122
123@@ -309,7 +309,7 @@
124 tryCompare([&](){ return parentItem->y(); }, 0);
125 QCOMPARE(parentItem->property("shown").toBool(), true);
126
127- dragHandle = fetchAndSetupDragHandle("upwardsDragHandle");
128+ dragHandle = fetchAndSetupDragHandle("topEdgeHideDragHandle");
129
130 dragThreshold = fetchDragThreshold(dragHandle);
131
132@@ -372,7 +372,7 @@
133
134 void tst_DragHandle::stretch_vertical()
135 {
136- QQuickItem *dragHandle = fetchAndSetupDragHandle("downwardsDragHandle");
137+ QQuickItem *dragHandle = fetchAndSetupDragHandle("topEdgeShowDragHandle");
138 qreal totalDragDistance = dragHandle->property("maxTotalDragDistance").toReal();
139 QQuickItem *parentItem = dragHandle->parentItem();
140
141@@ -389,7 +389,7 @@
142 tryCompare([&](){ return parentItem->height(); }, totalDragDistance);
143 QCOMPARE(parentItem->property("shown").toBool(), true);
144
145- dragHandle = fetchAndSetupDragHandle("upwardsDragHandle");
146+ dragHandle = fetchAndSetupDragHandle("topEdgeHideDragHandle");
147
148 // flick all the way
149 flickAndHold(dragHandle, totalDragDistance);
150@@ -408,7 +408,7 @@
151 */
152 void tst_DragHandle::hintingAnimation()
153 {
154- QQuickItem *dragHandle = fetchAndSetupDragHandle("downwardsDragHandle");
155+ QQuickItem *dragHandle = fetchAndSetupDragHandle("topEdgeShowDragHandle");
156 QQuickItem *parentItem = dragHandle->parentItem();
157 qreal hintDisplacement = 100.0;
158
159@@ -449,7 +449,7 @@
160 */
161 void tst_DragHandle::hintingAnimation_dontRestartAfterFinishedAndStillPressed()
162 {
163- QQuickItem *dragHandle = fetchAndSetupDragHandle("downwardsDragHandle");
164+ QQuickItem *dragHandle = fetchAndSetupDragHandle("topEdgeShowDragHandle");
165 QQuickItem *parentItem = dragHandle->parentItem();
166 qreal hintDisplacement = 100.0;
167
168
169=== modified file 'tests/qmltests/Components/tst_DragHandle.qml'
170--- tests/qmltests/Components/tst_DragHandle.qml 2015-12-16 15:23:24 +0000
171+++ tests/qmltests/Components/tst_DragHandle.qml 2016-05-18 21:31:43 +0000
172@@ -64,15 +64,33 @@
173 onDragHandleRecognizedGesture: { root.dragHandle = dragHandle }
174 }
175
176- VerticalShowable {
177- visible: !root.bidirectional
178- onDragHandleRecognizedGesture: { root.dragHandle = dragHandle }
179- stretch: root.stretch
180- hintDisplacement: root.hintDisplacement
181- }
182-
183- HorizontalShowable {
184- visible: !root.bidirectional
185+ TopEdgeShowable {
186+ id: topEdgeShowable
187+ visible: !root.bidirectional && !bottomEdgeShowable.shown
188+ onDragHandleRecognizedGesture: { root.dragHandle = dragHandle }
189+ stretch: root.stretch
190+ hintDisplacement: root.hintDisplacement
191+ }
192+
193+ BottomEdgeShowable {
194+ id: bottomEdgeShowable
195+ visible: !root.bidirectional && !topEdgeShowable.shown
196+ onDragHandleRecognizedGesture: { root.dragHandle = dragHandle }
197+ stretch: root.stretch
198+ hintDisplacement: root.hintDisplacement
199+ }
200+
201+ LeftEdgeShowable {
202+ id: leftEdgeShowable
203+ visible: !root.bidirectional && !rightEdgeShowable.shown
204+ onDragHandleRecognizedGesture: { root.dragHandle = dragHandle }
205+ stretch: root.stretch
206+ hintDisplacement: root.hintDisplacement
207+ }
208+
209+ RightEdgeShowable {
210+ id: rightEdgeShowable
211+ visible: !root.bidirectional && !leftEdgeShowable.shown
212 onDragHandleRecognizedGesture: { root.dragHandle = dragHandle }
213 stretch: root.stretch
214 hintDisplacement: root.hintDisplacement
215
216=== added file 'tests/qmltests/Components/tst_DragHandle/BottomEdgeShowable.qml'
217--- tests/qmltests/Components/tst_DragHandle/BottomEdgeShowable.qml 1970-01-01 00:00:00 +0000
218+++ tests/qmltests/Components/tst_DragHandle/BottomEdgeShowable.qml 2016-05-18 21:31:43 +0000
219@@ -0,0 +1,108 @@
220+/*
221+ * Copyright (C) 2016 Canonical, Ltd.
222+ *
223+ * This program is free software; you can redistribute it and/or modify
224+ * it under the terms of the GNU General Public License as published by
225+ * the Free Software Foundation; version 3.
226+ *
227+ * This program is distributed in the hope that it will be useful,
228+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
229+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
230+ * GNU General Public License for more details.
231+ *
232+ * You should have received a copy of the GNU General Public License
233+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
234+ */
235+
236+import QtQuick 2.4
237+import "../../../../qml/Components"
238+import Ubuntu.Components 1.3
239+import Ubuntu.Gestures 0.1
240+
241+Showable {
242+ id: root
243+ y: height
244+ width: parent.width
245+ height: parent.height
246+
247+ property bool stretch
248+ property real hintDisplacement
249+
250+ Binding {
251+ when: stretch
252+ target: root
253+ property: "y"
254+ value: root.parent.height - root.height
255+ }
256+
257+ onStretchChanged: {
258+ // reset
259+ shown = false;
260+ if (stretch) {
261+ height = 0;
262+ } else {
263+ y = parent.height;
264+ height = parent.height;
265+ }
266+ }
267+
268+ shown: false
269+
270+ signal dragHandleRecognizedGesture(var dragHandle)
271+
272+ property string animatedProp: stretch ? "height" : "y"
273+ property real propValueWhenShown: stretch ? parent.height : 0
274+ property real propValueWhenHidden: stretch ? 0 : height
275+
276+ showAnimation: StandardAnimation { property: animatedProp; to: propValueWhenShown }
277+ hideAnimation: StandardAnimation { property: animatedProp; to: propValueWhenHidden }
278+
279+ Image { source: "../../UnityLogo.png"; anchors.fill: parent }
280+
281+ DragHandle {
282+ objectName: "topEdgeHideDragHandle"
283+ id: hideDragHandle
284+ anchors.left: parent.left
285+ anchors.right: parent.right
286+ anchors.top: parent.top
287+
288+ height: units.gu(2)
289+
290+ direction: Direction.Downwards
291+ stretch: root.stretch
292+ maxTotalDragDistance: root.parent.height
293+ hintDisplacement: root.hintDisplacement
294+
295+ onDraggingChanged: {
296+ if (dragging) {
297+ dragHandleRecognizedGesture(hideDragHandle);
298+ }
299+ }
300+
301+ Rectangle { color: "red"; anchors.fill: parent }
302+ }
303+
304+ DragHandle {
305+ objectName: "topEdgeShowDragHandle"
306+ id: showDragHandle
307+ anchors.left: parent.left
308+ anchors.right: parent.right
309+ anchors.bottom: parent.top
310+
311+ height: units.gu(2)
312+
313+ direction: Direction.Upwards
314+ stretch: root.stretch
315+ maxTotalDragDistance: root.parent.height
316+ hintDisplacement: root.hintDisplacement
317+
318+ onDraggingChanged: {
319+ if (dragging) {
320+ dragHandleRecognizedGesture(showDragHandle);
321+ }
322+ }
323+
324+ Rectangle { color: "green"; anchors.fill: parent }
325+ }
326+
327+}
328
329=== renamed file 'tests/qmltests/Components/tst_DragHandle/HorizontalShowable.qml' => 'tests/qmltests/Components/tst_DragHandle/LeftEdgeShowable.qml'
330=== added file 'tests/qmltests/Components/tst_DragHandle/RightEdgeShowable.qml'
331--- tests/qmltests/Components/tst_DragHandle/RightEdgeShowable.qml 1970-01-01 00:00:00 +0000
332+++ tests/qmltests/Components/tst_DragHandle/RightEdgeShowable.qml 2016-05-18 21:31:43 +0000
333@@ -0,0 +1,108 @@
334+/*
335+ * Copyright (C) 2016 Canonical, Ltd.
336+ *
337+ * This program is free software; you can redistribute it and/or modify
338+ * it under the terms of the GNU General Public License as published by
339+ * the Free Software Foundation; version 3.
340+ *
341+ * This program is distributed in the hope that it will be useful,
342+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
343+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
344+ * GNU General Public License for more details.
345+ *
346+ * You should have received a copy of the GNU General Public License
347+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
348+ */
349+
350+import QtQuick 2.4
351+import "../../../../qml/Components"
352+import Ubuntu.Components 1.3
353+import Ubuntu.Gestures 0.1
354+
355+Showable {
356+ id: root
357+ x: parent.width
358+ width: parent.width
359+ height: parent.height
360+
361+ property bool stretch
362+ property real hintDisplacement
363+
364+ Binding {
365+ when: stretch
366+ target: root
367+ property: "x"
368+ value: root.parent.width - root.width
369+ }
370+
371+ onStretchChanged: {
372+ // reset
373+ shown = false;
374+ if (stretch) {
375+ width = 0;
376+ } else {
377+ x = parent.width;
378+ width = parent.width;
379+ }
380+ }
381+
382+ shown: false
383+
384+ signal dragHandleRecognizedGesture(var dragHandle)
385+
386+ property string animatedProp: stretch ? "width" : "x"
387+ property real propValueWhenShown: stretch ? parent.width : 0
388+ property real propValueWhenHidden: stretch ? 0 : parent.width
389+
390+ showAnimation: StandardAnimation { property: animatedProp; to: propValueWhenShown }
391+ hideAnimation: StandardAnimation { property: animatedProp; to: propValueWhenHidden }
392+
393+ Image { source: "../../UnityLogo.png"; anchors.fill: parent }
394+
395+ DragHandle {
396+ objectName: "rightEdgeHideDragHandle"
397+ id: hideDragHandle
398+ anchors.top: parent.top
399+ anchors.bottom: parent.bottom
400+ anchors.left: parent.left
401+
402+ width: units.gu(2)
403+
404+ direction: Direction.Rightwards
405+ stretch: root.stretch
406+ maxTotalDragDistance: root.parent.width
407+ hintDisplacement: root.hintDisplacement
408+
409+ onDraggingChanged: {
410+ if (dragging) {
411+ dragHandleRecognizedGesture(hideDragHandle);
412+ }
413+ }
414+
415+ Rectangle { color: "red"; anchors.fill: parent }
416+ }
417+
418+ DragHandle {
419+ objectName: "rightEdgeShowDragHandle"
420+ id: showDragHandle
421+ anchors.top: parent.top
422+ anchors.bottom: parent.bottom
423+ anchors.right: parent.left
424+
425+ width: units.gu(2)
426+
427+ direction: Direction.Leftwards
428+ stretch: root.stretch
429+ maxTotalDragDistance: root.parent.width
430+ hintDisplacement: root.hintDisplacement
431+
432+ onDraggingChanged: {
433+ if (dragging) {
434+ dragHandleRecognizedGesture(showDragHandle);
435+ }
436+ }
437+
438+ Rectangle { color: "green"; anchors.fill: parent }
439+ }
440+
441+}
442
443=== renamed file 'tests/qmltests/Components/tst_DragHandle/VerticalShowable.qml' => 'tests/qmltests/Components/tst_DragHandle/TopEdgeShowable.qml'
444--- tests/qmltests/Components/tst_DragHandle/VerticalShowable.qml 2015-07-15 15:07:19 +0000
445+++ tests/qmltests/Components/tst_DragHandle/TopEdgeShowable.qml 2016-05-18 21:31:43 +0000
446@@ -1,5 +1,5 @@
447 /*
448- * Copyright (C) 2013 Canonical, Ltd.
449+ * Copyright (C) 2013,2016 Canonical, Ltd.
450 *
451 * This program is free software; you can redistribute it and/or modify
452 * it under the terms of the GNU General Public License as published by
453@@ -52,8 +52,8 @@
454 Image { source: "../../UnityLogo.png"; anchors.fill: parent }
455
456 DragHandle {
457- objectName: "upwardsDragHandle"
458- id: upwardsDragHandle
459+ objectName: "topEdgeHideDragHandle"
460+ id: hideDragHandle
461 anchors.left: parent.left
462 anchors.right: parent.right
463 anchors.bottom: parent.bottom
464@@ -67,7 +67,7 @@
465
466 onDraggingChanged: {
467 if (dragging) {
468- dragHandleRecognizedGesture(upwardsDragHandle);
469+ dragHandleRecognizedGesture(hideDragHandle);
470 }
471 }
472
473@@ -75,8 +75,8 @@
474 }
475
476 DragHandle {
477- objectName: "downwardsDragHandle"
478- id: downwardsDragHandle
479+ objectName: "topEdgeShowDragHandle"
480+ id: showDragHandle
481 anchors.left: parent.left
482 anchors.right: parent.right
483 anchors.top: parent.bottom
484@@ -90,7 +90,7 @@
485
486 onDraggingChanged: {
487 if (dragging) {
488- dragHandleRecognizedGesture(downwardsDragHandle);
489+ dragHandleRecognizedGesture(showDragHandle);
490 }
491 }
492

Subscribers

People subscribed via source and target branches