Merge lp:~dandrader/unity8/remove_revealer into lp:unity8
- remove_revealer
- Merge into trunk
Status: | Merged |
---|---|
Approved by: | Albert Astals Cid |
Approved revision: | 893 |
Merged at revision: | 903 |
Proposed branch: | lp:~dandrader/unity8/remove_revealer |
Merge into: | lp:unity8 |
Diff against target: |
607 lines (+0/-582) 4 files modified
qml/Components/Revealer.qml (+0/-241) tests/qmltests/CMakeLists.txt (+0/-1) tests/qmltests/Components/RevealingRectangle.qml (+0/-78) tests/qmltests/Components/tst_Revealer.qml (+0/-262) |
To merge this branch: | bzr merge lp:~dandrader/unity8/remove_revealer |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Albert Astals Cid (community) | Approve | ||
PS Jenkins bot (community) | continuous-integration | Needs Fixing | |
Review via email: mp+219511@code.launchpad.net |
Commit message
Remove Revealer component
It's not used anywhere anymore. It's been replaced by DragHandle.
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?
No, but it's not really applicable to this case.
* 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?
Not applicable.
* If you changed the UI, has there been a design review?
Not applicable.
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:893
http://
Executed test runs:
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Albert Astals Cid (aacid) wrote : | # |
One day we'll get qmluitests back!
Preview Diff
1 | === removed file 'qml/Components/Revealer.qml' | |||
2 | --- qml/Components/Revealer.qml 2013-10-25 14:26:29 +0000 | |||
3 | +++ qml/Components/Revealer.qml 1970-01-01 00:00:00 +0000 | |||
4 | @@ -1,241 +0,0 @@ | |||
5 | 1 | /* | ||
6 | 2 | * Copyright (C) 2013 Canonical, Ltd. | ||
7 | 3 | * | ||
8 | 4 | * This program is free software; you can redistribute it and/or modify | ||
9 | 5 | * it under the terms of the GNU General Public License as published by | ||
10 | 6 | * the Free Software Foundation; version 3. | ||
11 | 7 | * | ||
12 | 8 | * This program is distributed in the hope that it will be useful, | ||
13 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
14 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
15 | 11 | * GNU General Public License for more details. | ||
16 | 12 | * | ||
17 | 13 | * You should have received a copy of the GNU General Public License | ||
18 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
19 | 15 | */ | ||
20 | 16 | |||
21 | 17 | import QtQuick 2.0 | ||
22 | 18 | import Ubuntu.Components 0.1 | ||
23 | 19 | |||
24 | 20 | Item { | ||
25 | 21 | id: revealer | ||
26 | 22 | |||
27 | 23 | property Showable target | ||
28 | 24 | property var hintingAnimation: hintingAnimation | ||
29 | 25 | property string boundProperty: orientation == Qt.Vertical ? "y" : "x" | ||
30 | 26 | property int orientation: Qt.Vertical | ||
31 | 27 | property int direction: Qt.LeftToRight | ||
32 | 28 | property real openedValue: orientation == Qt.Vertical ? y : x | ||
33 | 29 | property real closedValue: orientation == Qt.Vertical ? y + (direction == Qt.LeftToRight ? -height : height) : x + (direction == Qt.LeftToRight ? -width : width) | ||
34 | 30 | property real hintDisplacement: 0 | ||
35 | 31 | property real handleSize: units.gu(2) | ||
36 | 32 | property real dragVelocity: draggingArea.dragVelocity != 0 ? Math.abs(draggingArea.dragVelocity) : -1 | ||
37 | 33 | property real dragVelocityThreshold: units.gu(5) | ||
38 | 34 | property bool dragging: false | ||
39 | 35 | property bool pressed: draggingArea.pressed | ||
40 | 36 | property int lateralPosition: draggingArea.lateralPosition | ||
41 | 37 | property real dragPosition | ||
42 | 38 | property bool openOnPress: true | ||
43 | 39 | |||
44 | 40 | signal openPressed(int mouseX, int mouseY) | ||
45 | 41 | signal openReleased(int mouseX, int mouseY) | ||
46 | 42 | signal closePressed | ||
47 | 43 | signal openClicked | ||
48 | 44 | signal closeClicked | ||
49 | 45 | |||
50 | 46 | dragPosition: { | ||
51 | 47 | var value | ||
52 | 48 | if (orientation == Qt.Vertical) { | ||
53 | 49 | value = draggingArea.dragValue + draggingArea.y | ||
54 | 50 | if (direction == Qt.RightToLeft) { | ||
55 | 51 | value += draggingArea.height - height | ||
56 | 52 | } | ||
57 | 53 | } else { | ||
58 | 54 | value = draggingArea.dragValue + draggingArea.x | ||
59 | 55 | if (direction == Qt.RightToLeft) { | ||
60 | 56 | value += draggingArea.width - width | ||
61 | 57 | } | ||
62 | 58 | } | ||
63 | 59 | if (__opened) { | ||
64 | 60 | if (direction == Qt.LeftToRight) { | ||
65 | 61 | value += handleSize | ||
66 | 62 | } else { | ||
67 | 63 | value -= handleSize | ||
68 | 64 | } | ||
69 | 65 | } else if (dragging) { | ||
70 | 66 | if (direction == Qt.LeftToRight) { | ||
71 | 67 | value += hintDisplacement | ||
72 | 68 | } else { | ||
73 | 69 | value -= hintDisplacement | ||
74 | 70 | } | ||
75 | 71 | } | ||
76 | 72 | |||
77 | 73 | return value | ||
78 | 74 | } | ||
79 | 75 | property var draggingArea: leftDraggingArea.enabled ? leftDraggingArea : rightDraggingArea | ||
80 | 76 | |||
81 | 77 | property real __hintValue: closedValue + (direction == Qt.LeftToRight ? hintDisplacement : -hintDisplacement) | ||
82 | 78 | |||
83 | 79 | function dragToValue(dragPosition) { | ||
84 | 80 | return dragPosition + closedValue | ||
85 | 81 | } | ||
86 | 82 | |||
87 | 83 | property bool __opened: target.shown | ||
88 | 84 | enabled: target.available | ||
89 | 85 | |||
90 | 86 | // Can be replaced with a fake implementation during tests | ||
91 | 87 | // property var __getCurrentTimeMs: function () { return new Date().getTime() } | ||
92 | 88 | property var __dateTime: new function() { | ||
93 | 89 | this.getCurrentTimeMs = function() {return new Date().getTime()} | ||
94 | 90 | } | ||
95 | 91 | |||
96 | 92 | Component.onCompleted: target[boundProperty] = __opened ? openedValue : closedValue | ||
97 | 93 | onOpenedValueChanged: if (__opened && !dragging) target[boundProperty] = openedValue | ||
98 | 94 | onClosedValueChanged: if (!__opened && !dragging) target[boundProperty] = closedValue | ||
99 | 95 | |||
100 | 96 | function __computeValue(dragPosition) { | ||
101 | 97 | return MathUtils.clamp(dragToValue(dragPosition), __hintValue, openedValue) | ||
102 | 98 | } | ||
103 | 99 | |||
104 | 100 | function __open() { | ||
105 | 101 | hintingAnimation.stop() | ||
106 | 102 | target.show() | ||
107 | 103 | } | ||
108 | 104 | |||
109 | 105 | function __close() { | ||
110 | 106 | hintingAnimation.stop() | ||
111 | 107 | target.hide() | ||
112 | 108 | } | ||
113 | 109 | |||
114 | 110 | function __hint() { | ||
115 | 111 | target.showAnimation.stop() | ||
116 | 112 | target.hideAnimation.stop() | ||
117 | 113 | hintingAnimation.restart() | ||
118 | 114 | } | ||
119 | 115 | |||
120 | 116 | function __settle() { | ||
121 | 117 | hintingAnimation.stop() | ||
122 | 118 | if (__opened) target.show() | ||
123 | 119 | else target.hide() | ||
124 | 120 | } | ||
125 | 121 | |||
126 | 122 | function __startDragging() { | ||
127 | 123 | hintingAnimation.stop() | ||
128 | 124 | dragging = true | ||
129 | 125 | } | ||
130 | 126 | |||
131 | 127 | function __endDragging(dragVelocity) { | ||
132 | 128 | dragging = false | ||
133 | 129 | if (revealer.direction == Qt.RightToLeft) { | ||
134 | 130 | dragVelocity = -dragVelocity | ||
135 | 131 | } | ||
136 | 132 | if (Math.abs(dragVelocity) >= dragVelocityThreshold) { | ||
137 | 133 | if (dragVelocity > 0) __open() | ||
138 | 134 | else __close() | ||
139 | 135 | } else { | ||
140 | 136 | __settle() | ||
141 | 137 | } | ||
142 | 138 | } | ||
143 | 139 | |||
144 | 140 | Binding { | ||
145 | 141 | id: dragBinding | ||
146 | 142 | |||
147 | 143 | target: revealer.target | ||
148 | 144 | property: revealer.boundProperty | ||
149 | 145 | value: __computeValue(dragPosition) | ||
150 | 146 | when: dragging | ||
151 | 147 | } | ||
152 | 148 | |||
153 | 149 | SmoothedAnimation { | ||
154 | 150 | id: hintingAnimation | ||
155 | 151 | |||
156 | 152 | target: revealer.target | ||
157 | 153 | property: revealer.boundProperty | ||
158 | 154 | duration: 150 | ||
159 | 155 | to: revealer.__hintValue | ||
160 | 156 | } | ||
161 | 157 | |||
162 | 158 | DraggingArea { | ||
163 | 159 | id: leftDraggingArea | ||
164 | 160 | |||
165 | 161 | property bool isOpeningArea: revealer.direction == Qt.LeftToRight | ||
166 | 162 | |||
167 | 163 | height: orientation == Qt.Vertical ? handleSize : parent.height | ||
168 | 164 | width: orientation == Qt.Horizontal ? handleSize : parent.width | ||
169 | 165 | orientation: revealer.orientation | ||
170 | 166 | enabled: isOpeningArea ? !revealer.__opened : revealer.__opened | ||
171 | 167 | |||
172 | 168 | __dateTime: revealer.__dateTime | ||
173 | 169 | |||
174 | 170 | onPressed: { | ||
175 | 171 | if (isOpeningArea) { | ||
176 | 172 | if (revealer.openOnPress) { | ||
177 | 173 | revealer.openPressed(mouseX, mouseY) | ||
178 | 174 | __hint() | ||
179 | 175 | } | ||
180 | 176 | } else { | ||
181 | 177 | revealer.closePressed() | ||
182 | 178 | } | ||
183 | 179 | } | ||
184 | 180 | onReleased: { | ||
185 | 181 | if (isOpeningArea && revealer.openOnPress) { | ||
186 | 182 | revealer.openReleased(mouseX, mouseY) | ||
187 | 183 | __settle() | ||
188 | 184 | } | ||
189 | 185 | } | ||
190 | 186 | onDragStart: __startDragging() | ||
191 | 187 | onDragEnd: __endDragging(dragVelocity) | ||
192 | 188 | onClicked: { | ||
193 | 189 | if (clickValidated) { | ||
194 | 190 | if (isOpeningArea) { | ||
195 | 191 | if (revealer.openOnPress) revealer.openClicked() | ||
196 | 192 | } else { | ||
197 | 193 | revealer.closeClicked() | ||
198 | 194 | } | ||
199 | 195 | } | ||
200 | 196 | } | ||
201 | 197 | } | ||
202 | 198 | |||
203 | 199 | DraggingArea { | ||
204 | 200 | id: rightDraggingArea | ||
205 | 201 | |||
206 | 202 | property bool isOpeningArea: revealer.direction == Qt.RightToLeft | ||
207 | 203 | |||
208 | 204 | x: orientation == Qt.Vertical ? 0 : parent.width - width | ||
209 | 205 | y: orientation == Qt.Vertical ? parent.height - height : 0 | ||
210 | 206 | height: orientation == Qt.Vertical ? handleSize : parent.height | ||
211 | 207 | width: orientation == Qt.Horizontal ? handleSize : parent.width | ||
212 | 208 | orientation: revealer.orientation | ||
213 | 209 | enabled: isOpeningArea ? !revealer.__opened : revealer.__opened | ||
214 | 210 | |||
215 | 211 | __dateTime: revealer.__dateTime | ||
216 | 212 | |||
217 | 213 | onPressed: { | ||
218 | 214 | if (isOpeningArea) { | ||
219 | 215 | if (revealer.openOnPress) { | ||
220 | 216 | revealer.openPressed(mouseX, mouseY) | ||
221 | 217 | __hint() | ||
222 | 218 | } | ||
223 | 219 | } else { | ||
224 | 220 | revealer.closePressed() | ||
225 | 221 | } | ||
226 | 222 | } | ||
227 | 223 | onReleased: { | ||
228 | 224 | if (isOpeningArea && revealer.openOnPress) { | ||
229 | 225 | revealer.openReleased(mouseX, mouseY) | ||
230 | 226 | __settle() | ||
231 | 227 | } | ||
232 | 228 | } | ||
233 | 229 | onDragStart: __startDragging() | ||
234 | 230 | onDragEnd: __endDragging(dragVelocity) | ||
235 | 231 | onClicked: { | ||
236 | 232 | if (clickValidated) { | ||
237 | 233 | if (isOpeningArea) { | ||
238 | 234 | if (revealer.openOnPress) revealer.openClicked() | ||
239 | 235 | } else { | ||
240 | 236 | revealer.closeClicked() | ||
241 | 237 | } | ||
242 | 238 | } | ||
243 | 239 | } | ||
244 | 240 | } | ||
245 | 241 | } | ||
246 | 242 | 0 | ||
247 | === modified file 'tests/qmltests/CMakeLists.txt' | |||
248 | --- tests/qmltests/CMakeLists.txt 2014-05-06 07:55:56 +0000 | |||
249 | +++ tests/qmltests/CMakeLists.txt 2014-05-14 12:48:24 +0000 | |||
250 | @@ -28,7 +28,6 @@ | |||
251 | 28 | add_qml_test(Components Rating) | 28 | add_qml_test(Components Rating) |
252 | 29 | add_qml_test(Components ResponsiveFlowView) | 29 | add_qml_test(Components ResponsiveFlowView) |
253 | 30 | add_qml_test(Components ResponsiveGridView) | 30 | add_qml_test(Components ResponsiveGridView) |
254 | 31 | add_qml_test(Components Revealer) | ||
255 | 32 | add_qml_test(Components SeeMore) | 31 | add_qml_test(Components SeeMore) |
256 | 33 | add_qml_test(Components Showable) | 32 | add_qml_test(Components Showable) |
257 | 34 | add_qml_test(Components PageHeaderLabel) | 33 | add_qml_test(Components PageHeaderLabel) |
258 | 35 | 34 | ||
259 | === removed file 'tests/qmltests/Components/RevealingRectangle.qml' | |||
260 | --- tests/qmltests/Components/RevealingRectangle.qml 2013-12-17 16:04:47 +0000 | |||
261 | +++ tests/qmltests/Components/RevealingRectangle.qml 1970-01-01 00:00:00 +0000 | |||
262 | @@ -1,78 +0,0 @@ | |||
263 | 1 | /* | ||
264 | 2 | * Copyright (C) 2013 Canonical, Ltd. | ||
265 | 3 | * | ||
266 | 4 | * This program is free software; you can redistribute it and/or modify | ||
267 | 5 | * it under the terms of the GNU General Public License as published by | ||
268 | 6 | * the Free Software Foundation; version 3. | ||
269 | 7 | * | ||
270 | 8 | * This program is distributed in the hope that it will be useful, | ||
271 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
272 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
273 | 11 | * GNU General Public License for more details. | ||
274 | 12 | * | ||
275 | 13 | * You should have received a copy of the GNU General Public License | ||
276 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
277 | 15 | */ | ||
278 | 16 | |||
279 | 17 | import QtQuick 2.0 | ||
280 | 18 | import Ubuntu.Components 0.1 | ||
281 | 19 | import "../../../qml/Components" | ||
282 | 20 | |||
283 | 21 | Item { | ||
284 | 22 | id: revealingRectangle | ||
285 | 23 | |||
286 | 24 | property int orientation: Qt.Vertical | ||
287 | 25 | property int direction: Qt.LeftToRight | ||
288 | 26 | property Revealer revealer: __revealer | ||
289 | 27 | property Showable showable: __showable | ||
290 | 28 | |||
291 | 29 | Revealer { | ||
292 | 30 | id: __revealer | ||
293 | 31 | |||
294 | 32 | target: __showable | ||
295 | 33 | width: target.width | ||
296 | 34 | height: target.height | ||
297 | 35 | x: orientation == Qt.Vertical ? 0 : direction == Qt.LeftToRight ? 0 : parent.width - width | ||
298 | 36 | y: orientation == Qt.Horizontal ? 0 : direction == Qt.LeftToRight ? 0 : parent.height - height | ||
299 | 37 | handleSize: orientation == Qt.Vertical ? handle.height : handle.width | ||
300 | 38 | hintDisplacement: handleSize | ||
301 | 39 | orientation: revealingRectangle.orientation | ||
302 | 40 | direction: revealingRectangle.direction | ||
303 | 41 | } | ||
304 | 42 | |||
305 | 43 | Showable { | ||
306 | 44 | id: __showable | ||
307 | 45 | |||
308 | 46 | width: orientation == Qt.Horizontal ? units.gu(24) : parent.width | ||
309 | 47 | height: orientation == Qt.Vertical ? units.gu(24) : parent.height | ||
310 | 48 | |||
311 | 49 | shown: false | ||
312 | 50 | showAnimation: SmoothedAnimation { | ||
313 | 51 | property: orientation == Qt.Horizontal ? "x" : "y" | ||
314 | 52 | velocity: __revealer.dragVelocity | ||
315 | 53 | duration: 200 | ||
316 | 54 | to: __revealer.openedValue | ||
317 | 55 | } | ||
318 | 56 | hideAnimation: SmoothedAnimation { | ||
319 | 57 | property: orientation == Qt.Horizontal ? "x" : "y" | ||
320 | 58 | velocity: __revealer.dragVelocity | ||
321 | 59 | duration: 200 | ||
322 | 60 | to: __revealer.closedValue | ||
323 | 61 | } | ||
324 | 62 | |||
325 | 63 | Rectangle { | ||
326 | 64 | anchors.fill: parent | ||
327 | 65 | color: "red" | ||
328 | 66 | } | ||
329 | 67 | |||
330 | 68 | Rectangle { | ||
331 | 69 | id: handle | ||
332 | 70 | |||
333 | 71 | x: orientation == Qt.Vertical ? 0 : direction == Qt.LeftToRight ? parent.width - width : 0 | ||
334 | 72 | y: orientation == Qt.Horizontal ? 0 : direction == Qt.LeftToRight ? parent.height - height : 0 | ||
335 | 73 | width: orientation == Qt.Horizontal ? units.gu(2) : parent.width | ||
336 | 74 | height: orientation == Qt.Vertical ? units.gu(2) : parent.height | ||
337 | 75 | color: "black" | ||
338 | 76 | } | ||
339 | 77 | } | ||
340 | 78 | } | ||
341 | 79 | 0 | ||
342 | === removed file 'tests/qmltests/Components/tst_Revealer.qml' | |||
343 | --- tests/qmltests/Components/tst_Revealer.qml 2013-06-05 22:03:08 +0000 | |||
344 | +++ tests/qmltests/Components/tst_Revealer.qml 1970-01-01 00:00:00 +0000 | |||
345 | @@ -1,262 +0,0 @@ | |||
346 | 1 | /* | ||
347 | 2 | * Copyright 2013 Canonical Ltd. | ||
348 | 3 | * | ||
349 | 4 | * This program is free software; you can redistribute it and/or modify | ||
350 | 5 | * it under the terms of the GNU General Public License as published by | ||
351 | 6 | * the Free Software Foundation; version 3. | ||
352 | 7 | * | ||
353 | 8 | * This program is distributed in the hope that it will be useful, | ||
354 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
355 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
356 | 11 | * GNU General Public License for more details. | ||
357 | 12 | * | ||
358 | 13 | * You should have received a copy of the GNU General Public License | ||
359 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
360 | 15 | */ | ||
361 | 16 | |||
362 | 17 | import QtQuick 2.0 | ||
363 | 18 | import QtTest 1.0 | ||
364 | 19 | import Unity.Test 0.1 as UT | ||
365 | 20 | import ".." | ||
366 | 21 | |||
367 | 22 | /* | ||
368 | 23 | There's a revealer on each window edge. If you press and hold any edge you | ||
369 | 24 | should see a black bar appearing from that edge. If you them slide the | ||
370 | 25 | pointer/finger towards the opposite edge, that black bar should follow | ||
371 | 26 | the movement up to around the center of the window. Next to the black bar, | ||
372 | 27 | which represents the "handle" area of the Revealer, You should see a red rectangle, | ||
373 | 28 | which is the main body of the Showable concrolled by the Revealer (Showable = red | ||
374 | 29 | + black rects). | ||
375 | 30 | */ | ||
376 | 31 | Item { | ||
377 | 32 | width: units.gu(75) | ||
378 | 33 | height: units.gu(50) | ||
379 | 34 | |||
380 | 35 | RevealingRectangle { | ||
381 | 36 | id: topRevealingRectangle | ||
382 | 37 | anchors.fill: parent | ||
383 | 38 | orientation: Qt.Vertical | ||
384 | 39 | direction: Qt.LeftToRight | ||
385 | 40 | } | ||
386 | 41 | |||
387 | 42 | RevealingRectangle { | ||
388 | 43 | id: bottomRevealingRectangle | ||
389 | 44 | anchors.fill: parent | ||
390 | 45 | orientation: Qt.Vertical | ||
391 | 46 | direction: Qt.RightToLeft | ||
392 | 47 | } | ||
393 | 48 | |||
394 | 49 | RevealingRectangle { | ||
395 | 50 | id: leftRevealingRectangle | ||
396 | 51 | anchors.fill: parent | ||
397 | 52 | orientation: Qt.Horizontal | ||
398 | 53 | direction: Qt.LeftToRight | ||
399 | 54 | } | ||
400 | 55 | |||
401 | 56 | RevealingRectangle { | ||
402 | 57 | id: rightRevealingRectangle | ||
403 | 58 | anchors.fill: parent | ||
404 | 59 | orientation: Qt.Horizontal | ||
405 | 60 | direction: Qt.RightToLeft | ||
406 | 61 | } | ||
407 | 62 | |||
408 | 63 | UT.UnityTestCase { | ||
409 | 64 | name: "Revealer" | ||
410 | 65 | when: windowShown | ||
411 | 66 | |||
412 | 67 | /* | ||
413 | 68 | A bit of the showable should be displayed when you press over the | ||
414 | 69 | handle area of the Revealer. | ||
415 | 70 | |||
416 | 71 | Once released, it should go out of sight again. | ||
417 | 72 | */ | ||
418 | 73 | function test_showHintOnPress() { | ||
419 | 74 | var revealer = topRevealingRectangle.revealer | ||
420 | 75 | var showable = topRevealingRectangle.showable | ||
421 | 76 | |||
422 | 77 | // It starts out of sight | ||
423 | 78 | compare(showable.y, -showable.height) | ||
424 | 79 | |||
425 | 80 | // (item, x, y, button, modifiers, delay) | ||
426 | 81 | mousePress(revealer, | ||
427 | 82 | revealer.width/2, | ||
428 | 83 | revealer.handleSize/2, | ||
429 | 84 | Qt.LeftButton, Qt.NoModifier, 0); | ||
430 | 85 | |||
431 | 86 | tryCompare(showable, "y", -showable.height + revealer.handleSize) | ||
432 | 87 | |||
433 | 88 | // (item, x, y, button, modifiers, delay) | ||
434 | 89 | mouseRelease(revealer, | ||
435 | 90 | revealer.width/2, | ||
436 | 91 | revealer.handleSize/2, | ||
437 | 92 | Qt.LeftButton, Qt.NoModifier, 0); | ||
438 | 93 | |||
439 | 94 | tryCompare(showable, "y", -showable.height) | ||
440 | 95 | } | ||
441 | 96 | |||
442 | 97 | /* | ||
443 | 98 | Press over the handle area of the Revealer and drag it to pull | ||
444 | 99 | its target Showable. Release it half-way and the Showable will | ||
445 | 100 | continue moving by itself until it's completely shown. | ||
446 | 101 | |||
447 | 102 | |||
448 | 103 | Press over the handle area and drag it back to hide the Showable. | ||
449 | 104 | Release it half-way and it will continue moving by itself until it's | ||
450 | 105 | completely hidden again. | ||
451 | 106 | */ | ||
452 | 107 | function test_dragToRevealAndDragBackToHide_top() { | ||
453 | 108 | var revealer = topRevealingRectangle.revealer | ||
454 | 109 | var showable = topRevealingRectangle.showable | ||
455 | 110 | revealer.__dateTime = fakeDateTime | ||
456 | 111 | |||
457 | 112 | // It starts out of sight | ||
458 | 113 | compare(showable.y, -showable.height) | ||
459 | 114 | |||
460 | 115 | mouseFlick(revealer, | ||
461 | 116 | revealer.width/2, // from_x | ||
462 | 117 | revealer.handleSize/2, // from_y | ||
463 | 118 | revealer.width/2, // to_x | ||
464 | 119 | showable.height/2); // to_y | ||
465 | 120 | |||
466 | 121 | // Should eventually get fully extended | ||
467 | 122 | tryCompare(showable, "y", 0) | ||
468 | 123 | |||
469 | 124 | // Now drag it back to get it hidden | ||
470 | 125 | |||
471 | 126 | mouseFlick(revealer, | ||
472 | 127 | revealer.width/2, | ||
473 | 128 | showable.height - (revealer.handleSize/2), | ||
474 | 129 | revealer.width/2, | ||
475 | 130 | showable.height/2) | ||
476 | 131 | |||
477 | 132 | // Should eventually be completely out of sight | ||
478 | 133 | tryCompare(showable, "y", -showable.height) | ||
479 | 134 | } | ||
480 | 135 | |||
481 | 136 | function test_dragToRevealAndDragBackToHide_bottom() { | ||
482 | 137 | var revealer = bottomRevealingRectangle.revealer | ||
483 | 138 | var showable = bottomRevealingRectangle.showable | ||
484 | 139 | var revRect = bottomRevealingRectangle | ||
485 | 140 | revealer.__dateTime = fakeDateTime | ||
486 | 141 | |||
487 | 142 | // It starts out of sight | ||
488 | 143 | compare(showable.y, revRect.height) | ||
489 | 144 | |||
490 | 145 | mouseFlick(revealer, | ||
491 | 146 | revealer.width/2, // from_x | ||
492 | 147 | revealer.height - revealer.handleSize/2, // from_y | ||
493 | 148 | revealer.width/2, // to_x | ||
494 | 149 | revealer.height - showable.height/2); // to_y | ||
495 | 150 | |||
496 | 151 | // Should eventually get fully extended | ||
497 | 152 | tryCompare(showable, "y", revRect.height - showable.height) | ||
498 | 153 | |||
499 | 154 | // Now drag it back to get it hidden | ||
500 | 155 | |||
501 | 156 | mouseFlick(revealer, | ||
502 | 157 | revealer.width/2, | ||
503 | 158 | revealer.handleSize/2, | ||
504 | 159 | revealer.width/2, | ||
505 | 160 | revealer.height - showable.height/2) | ||
506 | 161 | |||
507 | 162 | // Should eventually be completely out of sight | ||
508 | 163 | tryCompare(showable, "y", revRect.height) | ||
509 | 164 | } | ||
510 | 165 | |||
511 | 166 | function test_dragToRevealAndDragBackToHide_left() { | ||
512 | 167 | var revealer = leftRevealingRectangle.revealer | ||
513 | 168 | var showable = leftRevealingRectangle.showable | ||
514 | 169 | revealer.__dateTime = fakeDateTime | ||
515 | 170 | |||
516 | 171 | // It starts out of sight | ||
517 | 172 | compare(showable.x, -showable.width) | ||
518 | 173 | |||
519 | 174 | mouseFlick(revealer, | ||
520 | 175 | revealer.handleSize/2, // from_x | ||
521 | 176 | revealer.height/2, // from_y | ||
522 | 177 | showable.width/2, // to_x | ||
523 | 178 | revealer.height/2) // to_y | ||
524 | 179 | |||
525 | 180 | // Should eventually get fully extended | ||
526 | 181 | tryCompare(showable, "x", 0) | ||
527 | 182 | |||
528 | 183 | // Now drag it back to get it hidden | ||
529 | 184 | |||
530 | 185 | mouseFlick(revealer, | ||
531 | 186 | showable.width - (revealer.handleSize/2), | ||
532 | 187 | revealer.height/2, | ||
533 | 188 | showable.width/2, | ||
534 | 189 | revealer.height/2) | ||
535 | 190 | |||
536 | 191 | // Should eventually be completely out of sight | ||
537 | 192 | tryCompare(showable, "x", -showable.width) | ||
538 | 193 | } | ||
539 | 194 | |||
540 | 195 | function test_dragToRevealAndDragBackToHide_right() { | ||
541 | 196 | var revealer = rightRevealingRectangle.revealer | ||
542 | 197 | var showable = rightRevealingRectangle.showable | ||
543 | 198 | var revRect = rightRevealingRectangle | ||
544 | 199 | revealer.__dateTime = fakeDateTime | ||
545 | 200 | |||
546 | 201 | // It starts out of sight | ||
547 | 202 | compare(showable.x, revRect.width) | ||
548 | 203 | |||
549 | 204 | mouseFlick(revealer, | ||
550 | 205 | revealer.width - revealer.handleSize/2, // from_x | ||
551 | 206 | revealer.height/2, // from_y | ||
552 | 207 | revealer.width - showable.width/2, // to_x | ||
553 | 208 | revealer.height/2) // to_y | ||
554 | 209 | |||
555 | 210 | // Should eventually get fully extended | ||
556 | 211 | tryCompare(showable, "x", revRect.width - showable.width) | ||
557 | 212 | |||
558 | 213 | // Now drag it back to get it hidden | ||
559 | 214 | |||
560 | 215 | mouseFlick(revealer, | ||
561 | 216 | revealer.handleSize/2, | ||
562 | 217 | revealer.height/2, | ||
563 | 218 | revealer.width - showable.width/2, | ||
564 | 219 | revealer.height/2) | ||
565 | 220 | |||
566 | 221 | // Should eventually be completely out of sight | ||
567 | 222 | tryCompare(showable, "x", revRect.width) | ||
568 | 223 | } | ||
569 | 224 | |||
570 | 225 | /* | ||
571 | 226 | Start dragging down (pulling the showable into view) and then, | ||
572 | 227 | midway, drag a bit upwards and release it. | ||
573 | 228 | The showable should keep moving away, ending up hidden again. | ||
574 | 229 | */ | ||
575 | 230 | function test_dragForthAndBackReturnsOriginalState() { | ||
576 | 231 | var revealer = topRevealingRectangle.revealer | ||
577 | 232 | var showable = topRevealingRectangle.showable | ||
578 | 233 | revealer.__dateTime = fakeDateTime | ||
579 | 234 | |||
580 | 235 | // It starts out of sight | ||
581 | 236 | compare(showable.y, -showable.height) | ||
582 | 237 | |||
583 | 238 | mouseFlick(revealer, | ||
584 | 239 | revealer.width/2, // from_x | ||
585 | 240 | revealer.handleSize/2, // from_y | ||
586 | 241 | revealer.width/2, // to_x | ||
587 | 242 | showable.height/2, // to_y | ||
588 | 243 | true /* do press */, false /* don't release */); | ||
589 | 244 | |||
590 | 245 | // Should be about half-extended | ||
591 | 246 | verify(showable.y > -showable.height*3/4) | ||
592 | 247 | verify(showable.y < -showable.height*1/4) | ||
593 | 248 | |||
594 | 249 | |||
595 | 250 | // Now drag it back a bit | ||
596 | 251 | mouseFlick(revealer, | ||
597 | 252 | revealer.width/2, // from_x | ||
598 | 253 | showable.height/2, // from_y | ||
599 | 254 | revealer.width/2, // to_x | ||
600 | 255 | showable.height/4, // to_y | ||
601 | 256 | false /* don't press */, true /* do release */); | ||
602 | 257 | |||
603 | 258 | // Should eventually be completely out of sight again | ||
604 | 259 | tryCompare(showable, "y", -showable.height) | ||
605 | 260 | } | ||
606 | 261 | } | ||
607 | 262 | } |
* Did you perform an exploratory manual test run of the code change and any related functionality?
Yes, everything still works as Reveleaer wasn't used
* Did CI run pass? If not, please explain why.
Not yet, will wait for it before top approving