Merge lp:~nick-dedekind/unity8/remove.overview into lp:unity8
- remove.overview
- Merge into trunk
Status: | Merged |
---|---|
Approved by: | MichaĆ Sawicz |
Approved revision: | 117 |
Merged at revision: | 120 |
Proposed branch: | lp:~nick-dedekind/unity8/remove.overview |
Merge into: | lp:unity8 |
Diff against target: |
1420 lines (+74/-879) 15 files modified
Panel/IndicatorRow.qml (+1/-2) Panel/Indicators.qml (+21/-44) Panel/MenuContent.qml (+8/-67) Panel/Menus/IndicatorMenuWindow.qml (+0/-35) Panel/Menus/Overview.qml (+0/-70) Panel/Menus/Overview/FlightModeWidget.qml (+0/-60) Panel/Menus/Overview/OverviewGrid.qml (+0/-135) Panel/Menus/Overview/VolumeWidget.qml (+0/-88) tests/qmltests/CMakeLists.txt (+0/-2) tests/qmltests/Panel/Menus/tst_IndicatorMenuWindow.qml (+0/-68) tests/qmltests/Panel/tst_IndicatorRow.qml (+0/-14) tests/qmltests/Panel/tst_Indicators.qml (+1/-39) tests/qmltests/Panel/tst_MenuContent.qml (+10/-80) tests/qmltests/Panel/tst_Overview.qml (+0/-142) tests/qmltests/Panel/tst_Panel.qml (+33/-33) |
To merge this branch: | bzr merge lp:~nick-dedekind/unity8/remove.overview |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
PS Jenkins bot (community) | continuous-integration | Approve | |
Daniel d'Andrada (community) | Approve | ||
Review via email: mp+175294@code.launchpad.net |
Commit message
Removed overview from indicators.
Description of the change
Removed overview from indicators.
PS Jenkins bot (ps-jenkins) wrote : | # |
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:117
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Daniel d'Andrada (dandrader) wrote : | # |
Quite many changes are solely fixing coding style. It distracts from the relevant changes of this patch.
Daniel d'Andrada (dandrader) wrote : | # |
All seems to work and changes look fine, even though you're piggybacking a coding style cleanup.
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:117
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Autolanding.
More details in the following jenkins job:
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Nick Dedekind (nick-dedekind) wrote : | # |
> All seems to work and changes look fine, even though you're piggybacking a
> coding style cleanup.
Didn't want Saviq coming at me with semi-colon changes ;)
PS Jenkins bot (ps-jenkins) : | # |
Preview Diff
1 | === modified file 'Panel/IndicatorRow.qml' | |||
2 | --- Panel/IndicatorRow.qml 2013-06-17 09:02:14 +0000 | |||
3 | +++ Panel/IndicatorRow.qml 2013-07-17 16:45:32 +0000 | |||
4 | @@ -24,7 +24,6 @@ | |||
5 | 24 | readonly property int currentItemIndex: currentItem ? currentItem.ownIndex : -1 | 24 | readonly property int currentItemIndex: currentItem ? currentItem.ownIndex : -1 |
6 | 25 | property alias row: row | 25 | property alias row: row |
7 | 26 | property QtObject indicatorsModel: null | 26 | property QtObject indicatorsModel: null |
8 | 27 | property bool overviewActive: false // "state of the menu" | ||
9 | 28 | 27 | ||
10 | 29 | Behavior on y {NumberAnimation {duration: 300; easing.type: Easing.OutCubic} } | 28 | Behavior on y {NumberAnimation {duration: 300; easing.type: Easing.OutCubic} } |
11 | 30 | 29 | ||
12 | @@ -76,7 +75,7 @@ | |||
13 | 76 | height: indicatorRow.height | 75 | height: indicatorRow.height |
14 | 77 | y: { | 76 | y: { |
15 | 78 | //FIXME: all indicators will be initial for now. | 77 | //FIXME: all indicators will be initial for now. |
17 | 79 | if (!highlighted && !overviewActive && (indicatorRow.state == "locked" || indicatorRow.state == "commit")) { | 78 | if (!highlighted && (indicatorRow.state == "locked" || indicatorRow.state == "commit")) { |
18 | 80 | return -indicatorRow.height | 79 | return -indicatorRow.height |
19 | 81 | } else { | 80 | } else { |
20 | 82 | return 0 | 81 | return 0 |
21 | 83 | 82 | ||
22 | === modified file 'Panel/Indicators.qml' | |||
23 | --- Panel/Indicators.qml 2013-07-03 16:33:58 +0000 | |||
24 | +++ Panel/Indicators.qml 2013-07-17 16:45:32 +0000 | |||
25 | @@ -56,36 +56,22 @@ | |||
26 | 56 | 56 | ||
27 | 57 | onHeightChanged: { | 57 | onHeightChanged: { |
28 | 58 | // need to use handle.get_height(). As the handle height depends on indicators.height changes (but this is called first!) | 58 | // need to use handle.get_height(). As the handle height depends on indicators.height changes (but this is called first!) |
30 | 59 | var contentProgress = indicators.height - handle.get_height() | 59 | var contentProgress = indicators.height - handle.get_height(); |
31 | 60 | if (!showAnimation.running && !hideAnimation.running) { | 60 | if (!showAnimation.running && !hideAnimation.running) { |
32 | 61 | if (contentProgress <= hintValue && indicators.state == "reveal") { | 61 | if (contentProgress <= hintValue && indicators.state == "reveal") { |
35 | 62 | indicators.state = "hint" | 62 | indicators.state = "hint"; |
34 | 63 | menuContent.hideAll() | ||
36 | 64 | } else if (contentProgress > hintValue && contentProgress < lockThreshold) { | 63 | } else if (contentProgress > hintValue && contentProgress < lockThreshold) { |
39 | 65 | menuContent.showMenu() | 64 | indicators.state = "reveal"; |
38 | 66 | indicators.state = "reveal" | ||
40 | 67 | } else if (contentProgress >= lockThreshold && lockThreshold > 0) { | 65 | } else if (contentProgress >= lockThreshold && lockThreshold > 0) { |
49 | 68 | // If we've shown the overview and are closing the view with progress changes (revealer handle), | 66 | indicators.state = "locked"; |
42 | 69 | // we dont want to switch to a indicator menu until we hit reveal state. | ||
43 | 70 | if (menuContent.overviewActive) { | ||
44 | 71 | menuContent.showOverview() | ||
45 | 72 | } else { | ||
46 | 73 | menuContent.showMenu() | ||
47 | 74 | } | ||
48 | 75 | indicators.state = "locked" | ||
50 | 76 | } | 67 | } |
51 | 77 | } | 68 | } |
52 | 78 | 69 | ||
53 | 79 | if (contentProgress == 0) { | 70 | if (contentProgress == 0) { |
55 | 80 | menuContent.releaseContent() | 71 | menuContent.releaseContent(); |
56 | 81 | } | 72 | } |
57 | 82 | } | 73 | } |
58 | 83 | 74 | ||
59 | 84 | function openOverview() { | ||
60 | 85 | indicatorRow.currentItem = null | ||
61 | 86 | menuContent.showOverview() | ||
62 | 87 | } | ||
63 | 88 | |||
64 | 89 | function calculateCurrentItem(xValue, useBuffer) { | 75 | function calculateCurrentItem(xValue, useBuffer) { |
65 | 90 | var rowCoordinates | 76 | var rowCoordinates |
66 | 91 | var itemCoordinates | 77 | var itemCoordinates |
67 | @@ -93,7 +79,7 @@ | |||
68 | 93 | var distanceFromRightEdge | 79 | var distanceFromRightEdge |
69 | 94 | var bufferExceeded = false | 80 | var bufferExceeded = false |
70 | 95 | 81 | ||
72 | 96 | if (indicators.state == "commit" || indicators.state == "locked" || showAnimation.running || hideAnimation.running) return | 82 | if (indicators.state == "commit" || indicators.state == "locked" || showAnimation.running || hideAnimation.running) return; |
73 | 97 | 83 | ||
74 | 98 | /* | 84 | /* |
75 | 99 | If user drags the indicator handle bar down a distance hintValue or less, this is 0. | 85 | If user drags the indicator handle bar down a distance hintValue or less, this is 0. |
76 | @@ -102,14 +88,14 @@ | |||
77 | 102 | */ | 88 | */ |
78 | 103 | var verticalProgress = | 89 | var verticalProgress = |
79 | 104 | MathLocal.clamp((indicators.height - handle.height - hintValue) / | 90 | MathLocal.clamp((indicators.height - handle.height - hintValue) / |
81 | 105 | (lockThreshold - hintValue), 0, 1) | 91 | (lockThreshold - hintValue), 0, 1); |
82 | 106 | 92 | ||
83 | 107 | /* | 93 | /* |
84 | 108 | Percentage of an indicator icon's width the user's press can stray horizontally from the | 94 | Percentage of an indicator icon's width the user's press can stray horizontally from the |
85 | 109 | focused icon before we change focus to another icon. E.g. a value of 0.5 means you must | 95 | focused icon before we change focus to another icon. E.g. a value of 0.5 means you must |
86 | 110 | go right a distance of half an icon's width before focus moves to the icon on the right | 96 | go right a distance of half an icon's width before focus moves to the icon on the right |
87 | 111 | */ | 97 | */ |
89 | 112 | var maxBufferThreshold = 0.5 | 98 | var maxBufferThreshold = 0.5; |
90 | 113 | 99 | ||
91 | 114 | /* | 100 | /* |
92 | 115 | To help users find the indicator of their choice while opening the indicators, we add logic to add a | 101 | To help users find the indicator of their choice while opening the indicators, we add logic to add a |
93 | @@ -126,12 +112,12 @@ | |||
94 | 126 | itemCoordinates = indicatorRow.row.mapToItem(currentItem, rowCoordinates.x, 0); | 112 | itemCoordinates = indicatorRow.row.mapToItem(currentItem, rowCoordinates.x, 0); |
95 | 127 | distanceFromRightEdge = (currentItem.width - itemCoordinates.x) / (currentItem.width) | 113 | distanceFromRightEdge = (currentItem.width - itemCoordinates.x) / (currentItem.width) |
96 | 128 | if (Math.abs(currentItem.ownIndex - indicatorRow.currentItemIndex) > 1) { | 114 | if (Math.abs(currentItem.ownIndex - indicatorRow.currentItemIndex) > 1) { |
98 | 129 | bufferExceeded = true | 115 | bufferExceeded = true; |
99 | 130 | } else { | 116 | } else { |
100 | 131 | if (indicatorRow.currentItemIndex < currentItem.ownIndex && distanceFromRightEdge < (1 - effectiveBufferThreshold)) { | 117 | if (indicatorRow.currentItemIndex < currentItem.ownIndex && distanceFromRightEdge < (1 - effectiveBufferThreshold)) { |
102 | 132 | bufferExceeded = true | 118 | bufferExceeded = true; |
103 | 133 | } else if (indicatorRow.currentItemIndex > currentItem.ownIndex && distanceFromRightEdge > effectiveBufferThreshold) { | 119 | } else if (indicatorRow.currentItemIndex > currentItem.ownIndex && distanceFromRightEdge > effectiveBufferThreshold) { |
105 | 134 | bufferExceeded = true | 120 | bufferExceeded = true; |
106 | 135 | } | 121 | } |
107 | 136 | } | 122 | } |
108 | 137 | if ((!useBuffer || (useBuffer && bufferExceeded)) || indicatorRow.currentItem < 0 || indicatorRow.currentItem == null) { | 123 | if ((!useBuffer || (useBuffer && bufferExceeded)) || indicatorRow.currentItem < 0 || indicatorRow.currentItem == null) { |
109 | @@ -172,8 +158,7 @@ | |||
110 | 172 | bottom: parent.bottom | 158 | bottom: parent.bottom |
111 | 173 | } | 159 | } |
112 | 174 | indicatorsModel: indicatorsModel | 160 | indicatorsModel: indicatorsModel |
115 | 175 | animate: false | 161 | clip: !indicators.fullyOpened |
114 | 176 | clip: indicators.partiallyOpened | ||
116 | 177 | 162 | ||
117 | 178 | onMenuSelected: { | 163 | onMenuSelected: { |
118 | 179 | indicatorRow.setItem(index) | 164 | indicatorRow.setItem(index) |
119 | @@ -209,7 +194,7 @@ | |||
120 | 209 | clip: height < handleImage.height | 194 | clip: height < handleImage.height |
121 | 210 | 195 | ||
122 | 211 | function get_height() { | 196 | function get_height() { |
124 | 212 | return Math.max(Math.min(handleImage.height, indicators.height - handleImage.height), 0) | 197 | return Math.max(Math.min(handleImage.height, indicators.height - handleImage.height), 0); |
125 | 213 | } | 198 | } |
126 | 214 | 199 | ||
127 | 215 | BorderImage { | 200 | BorderImage { |
128 | @@ -264,7 +249,6 @@ | |||
129 | 264 | height: indicators.panelHeight | 249 | height: indicators.panelHeight |
130 | 265 | indicatorsModel: indicatorsModel | 250 | indicatorsModel: indicatorsModel |
131 | 266 | state: indicators.state | 251 | state: indicators.state |
132 | 267 | overviewActive: menuContent.overviewActive | ||
133 | 268 | 252 | ||
134 | 269 | onCurrentItemIndexChanged: menuContent.currentIndex = currentItemIndex | 253 | onCurrentItemIndexChanged: menuContent.currentIndex = currentItemIndex |
135 | 270 | 254 | ||
136 | @@ -279,9 +263,10 @@ | |||
137 | 279 | onRunningChanged: { | 263 | onRunningChanged: { |
138 | 280 | if (hideAnimation.running) { | 264 | if (hideAnimation.running) { |
139 | 281 | indicators.state = "initial" | 265 | indicators.state = "initial" |
140 | 282 | menuContent.hideAll() | ||
141 | 283 | } else { | 266 | } else { |
143 | 284 | if (state == "initial") indicatorRow.setDefaultItem() | 267 | if (state == "initial") { |
144 | 268 | indicatorRow.setDefaultItem() | ||
145 | 269 | } | ||
146 | 285 | } | 270 | } |
147 | 286 | } | 271 | } |
148 | 287 | } | 272 | } |
149 | @@ -289,13 +274,8 @@ | |||
150 | 289 | target: showAnimation | 274 | target: showAnimation |
151 | 290 | onRunningChanged: { | 275 | onRunningChanged: { |
152 | 291 | if (showAnimation.running) { | 276 | if (showAnimation.running) { |
160 | 292 | if (indicators.state == "initial") { | 277 | indicators.calculateCurrentItem(dragHandle.touchX, false); |
161 | 293 | openOverview() | 278 | indicators.state = "commit"; |
155 | 294 | } else { | ||
156 | 295 | indicators.calculateCurrentItem(dragHandle.touchX, false) | ||
157 | 296 | menuContent.showMenu() | ||
158 | 297 | } | ||
159 | 298 | indicators.state = "commit" | ||
162 | 299 | } | 279 | } |
163 | 300 | } | 280 | } |
164 | 301 | } | 281 | } |
165 | @@ -303,8 +283,8 @@ | |||
166 | 303 | Connections { | 283 | Connections { |
167 | 304 | target: dragHandle | 284 | target: dragHandle |
168 | 305 | onTouchXChanged: { | 285 | onTouchXChanged: { |
171 | 306 | var buffer = dragHandle.dragging ? true : false | 286 | var buffer = dragHandle.dragging ? true : false; |
172 | 307 | indicators.calculateCurrentItem(dragHandle.touchX, buffer) | 287 | indicators.calculateCurrentItem(dragHandle.touchX, buffer); |
173 | 308 | } | 288 | } |
174 | 309 | } | 289 | } |
175 | 310 | 290 | ||
176 | @@ -339,8 +319,7 @@ | |||
177 | 339 | 319 | ||
178 | 340 | onStatusChanged: { | 320 | onStatusChanged: { |
179 | 341 | if (status === DirectionalDragArea.Recognized) { | 321 | if (status === DirectionalDragArea.Recognized) { |
182 | 342 | menuContent.hideAll() | 322 | menuContent.activateContent(); |
181 | 343 | menuContent.activateContent() | ||
183 | 344 | } | 323 | } |
184 | 345 | } | 324 | } |
185 | 346 | } | 325 | } |
186 | @@ -368,7 +347,6 @@ | |||
187 | 368 | State { | 347 | State { |
188 | 369 | name: "reveal" | 348 | name: "reveal" |
189 | 370 | extend: "hint" | 349 | extend: "hint" |
190 | 371 | PropertyChanges { target: menuContent; animate: true } | ||
191 | 372 | StateChangeScript { script: calculateCurrentItem(dragHandle.touchX, false); } | 350 | StateChangeScript { script: calculateCurrentItem(dragHandle.touchX, false); } |
192 | 373 | }, | 351 | }, |
193 | 374 | State { | 352 | State { |
194 | @@ -390,7 +368,6 @@ | |||
195 | 390 | }, | 368 | }, |
196 | 391 | State { | 369 | State { |
197 | 392 | name: "reveal" | 370 | name: "reveal" |
198 | 393 | PropertyChanges { target: menuContent; animate: true } | ||
199 | 394 | StateChangeScript { script: calculateCurrentItem(dragHandle.touchX, false); } | 371 | StateChangeScript { script: calculateCurrentItem(dragHandle.touchX, false); } |
200 | 395 | }, | 372 | }, |
201 | 396 | State { | 373 | State { |
202 | 397 | 374 | ||
203 | === modified file 'Panel/MenuContent.qml' | |||
204 | --- Panel/MenuContent.qml 2013-07-17 11:03:15 +0000 | |||
205 | +++ Panel/MenuContent.qml 2013-07-17 16:45:32 +0000 | |||
206 | @@ -17,16 +17,12 @@ | |||
207 | 17 | import QtQuick 2.0 | 17 | import QtQuick 2.0 |
208 | 18 | import Ubuntu.Components 0.1 | 18 | import Ubuntu.Components 0.1 |
209 | 19 | import Unity.Indicators 0.1 as Indicators | 19 | import Unity.Indicators 0.1 as Indicators |
210 | 20 | import "Menus" | ||
211 | 21 | import "../Components" | 20 | import "../Components" |
212 | 22 | 21 | ||
213 | 23 | Rectangle { | 22 | Rectangle { |
214 | 24 | id: content | 23 | id: content |
215 | 25 | 24 | ||
216 | 26 | property QtObject indicatorsModel: null | 25 | property QtObject indicatorsModel: null |
217 | 27 | property bool animate: true // FIXME: Remove. This doesnt seem to be being used and it's referenced in Indicators. | ||
218 | 28 | property bool overviewActive: true // "state of the menu" | ||
219 | 29 | property bool __shown: false | ||
220 | 30 | property bool __contentActive: false | 26 | property bool __contentActive: false |
221 | 31 | property alias currentIndex : menus.currentIndex | 27 | property alias currentIndex : menus.currentIndex |
222 | 32 | property color backgroundColor: "#221e1c" // FIXME not in palette yet | 28 | property color backgroundColor: "#221e1c" // FIXME not in palette yet |
223 | @@ -35,32 +31,17 @@ | |||
224 | 35 | width: units.gu(40) | 31 | width: units.gu(40) |
225 | 36 | height: units.gu(42) | 32 | height: units.gu(42) |
226 | 37 | color: backgroundColor | 33 | color: backgroundColor |
227 | 38 | enabled: __shown | ||
228 | 39 | 34 | ||
229 | 40 | signal menuSelected(int index) | 35 | signal menuSelected(int index) |
230 | 41 | 36 | ||
231 | 42 | function showMenu() { | ||
232 | 43 | __shown = true | ||
233 | 44 | overviewActive = false | ||
234 | 45 | } | ||
235 | 46 | |||
236 | 47 | function showOverview() { | ||
237 | 48 | __shown = true | ||
238 | 49 | overviewActive = true | ||
239 | 50 | } | ||
240 | 51 | |||
241 | 52 | function hideAll() { | ||
242 | 53 | __shown = false | ||
243 | 54 | } | ||
244 | 55 | |||
245 | 56 | function activateContent() { | 37 | function activateContent() { |
248 | 57 | contentReleaseTimer.stop() | 38 | contentReleaseTimer.stop(); |
249 | 58 | __contentActive = true | 39 | __contentActive = true; |
250 | 59 | } | 40 | } |
251 | 60 | 41 | ||
252 | 61 | function releaseContent() { | 42 | function releaseContent() { |
253 | 62 | if (__contentActive) | 43 | if (__contentActive) |
255 | 63 | contentReleaseTimer.restart() | 44 | contentReleaseTimer.restart(); |
256 | 64 | } | 45 | } |
257 | 65 | 46 | ||
258 | 66 | ListView { | 47 | ListView { |
259 | @@ -72,7 +53,6 @@ | |||
260 | 72 | width: parent.width | 53 | width: parent.width |
261 | 73 | 54 | ||
262 | 74 | spacing: units.gu(0.5) | 55 | spacing: units.gu(0.5) |
263 | 75 | opacity: !overviewActive && __shown ? 1 : 0 | ||
264 | 76 | enabled: opacity != 0 | 56 | enabled: opacity != 0 |
265 | 77 | orientation: ListView.Horizontal | 57 | orientation: ListView.Horizontal |
266 | 78 | model: indicatorsModel | 58 | model: indicatorsModel |
267 | @@ -87,20 +67,19 @@ | |||
268 | 87 | 67 | ||
269 | 88 | onContentActiveChanged: { | 68 | onContentActiveChanged: { |
270 | 89 | if (contentActive && item) { | 69 | if (contentActive && item) { |
272 | 90 | item.start() | 70 | item.start(); |
273 | 91 | } else if (!contentActive && item) { | 71 | } else if (!contentActive && item) { |
275 | 92 | item.stop() | 72 | item.stop(); |
276 | 93 | } | 73 | } |
277 | 94 | } | 74 | } |
278 | 95 | 75 | ||
279 | 96 | width: menus.width | 76 | width: menus.width |
280 | 97 | height: menus.height | 77 | height: menus.height |
281 | 98 | source: pageSource | 78 | source: pageSource |
282 | 99 | visible: content.__shown | ||
283 | 100 | onVisibleChanged: { | 79 | onVisibleChanged: { |
284 | 101 | // Reset the indicator states | 80 | // Reset the indicator states |
285 | 102 | if (!visible && item && item["reset"]) { | 81 | if (!visible && item && item["reset"]) { |
287 | 103 | item.reset() | 82 | item.reset(); |
288 | 104 | } | 83 | } |
289 | 105 | } | 84 | } |
290 | 106 | asynchronous: true | 85 | asynchronous: true |
291 | @@ -108,11 +87,11 @@ | |||
292 | 108 | onLoaded: { | 87 | onLoaded: { |
293 | 109 | for(var pName in indicatorProperties) { | 88 | for(var pName in indicatorProperties) { |
294 | 110 | if (item.hasOwnProperty(pName)) { | 89 | if (item.hasOwnProperty(pName)) { |
296 | 111 | item[pName] = indicatorProperties[pName] | 90 | item[pName] = indicatorProperties[pName]; |
297 | 112 | } | 91 | } |
298 | 113 | } | 92 | } |
299 | 114 | if (contentActive && menus.visible) { | 93 | if (contentActive && menus.visible) { |
301 | 115 | item.start() | 94 | item.start(); |
302 | 116 | } | 95 | } |
303 | 117 | } | 96 | } |
304 | 118 | 97 | ||
305 | @@ -124,40 +103,6 @@ | |||
306 | 124 | value: handle.height | 103 | value: handle.height |
307 | 125 | } | 104 | } |
308 | 126 | } | 105 | } |
309 | 127 | |||
310 | 128 | Behavior on opacity { NumberAnimation {duration: 200} } | ||
311 | 129 | } | ||
312 | 130 | |||
313 | 131 | Overview { | ||
314 | 132 | id: overview | ||
315 | 133 | objectName: "overview" | ||
316 | 134 | |||
317 | 135 | anchors.top: header.bottom | ||
318 | 136 | anchors.bottom: parent.bottom | ||
319 | 137 | // FIXME: Dont know why we're using handle height (introduces dep).. Check with design about bottom margin | ||
320 | 138 | anchors.bottomMargin: handle.height | ||
321 | 139 | |||
322 | 140 | width: content.width | ||
323 | 141 | indicatorsModel: content.indicatorsModel | ||
324 | 142 | enabled: content.overviewActive && content.__shown | ||
325 | 143 | opacity: content.overviewActive && content.__shown ? 1 : 0 | ||
326 | 144 | Behavior on opacity {NumberAnimation{duration: 200}} | ||
327 | 145 | visible: opacity != 0 | ||
328 | 146 | |||
329 | 147 | onMenuSelected: { | ||
330 | 148 | var storedDuration = menus.highlightMoveDuration | ||
331 | 149 | var storedVelocity = menus.highlightMoveVelocity | ||
332 | 150 | menus.highlightMoveDuration = 0 | ||
333 | 151 | menus.highlightMoveVelocity = 100000 | ||
334 | 152 | |||
335 | 153 | menus.currentIndex = modelIndex | ||
336 | 154 | content.overviewActive = false | ||
337 | 155 | |||
338 | 156 | menus.highlightMoveDuration = storedDuration | ||
339 | 157 | menus.highlightMoveVelocity = storedVelocity | ||
340 | 158 | |||
341 | 159 | content.menuSelected(modelIndex) | ||
342 | 160 | } | ||
343 | 161 | } | 106 | } |
344 | 162 | 107 | ||
345 | 163 | Rectangle { | 108 | Rectangle { |
346 | @@ -181,14 +126,10 @@ | |||
347 | 181 | right: parent.right | 126 | right: parent.right |
348 | 182 | } | 127 | } |
349 | 183 | text: { | 128 | text: { |
350 | 184 | if (content.overviewActive) | ||
351 | 185 | return i18n.tr("Device"); | ||
352 | 186 | if (indicatorsModel && menus.currentIndex >= 0 && menus.currentIndex < indicatorsModel.count) | 129 | if (indicatorsModel && menus.currentIndex >= 0 && menus.currentIndex < indicatorsModel.count) |
353 | 187 | return indicatorsModel.data(menus.currentIndex, Indicators.IndicatorsModelRole.Title); | 130 | return indicatorsModel.data(menus.currentIndex, Indicators.IndicatorsModelRole.Title); |
354 | 188 | return ""; | 131 | return ""; |
355 | 189 | } | 132 | } |
356 | 190 | opacity: __shown ? 1 : 0 | ||
357 | 191 | Behavior on opacity {NumberAnimation{duration: 100}} | ||
358 | 192 | } | 133 | } |
359 | 193 | } | 134 | } |
360 | 194 | 135 | ||
361 | 195 | 136 | ||
362 | === removed directory 'Panel/Menus' | |||
363 | === removed file 'Panel/Menus/IndicatorMenuWindow.qml' | |||
364 | --- Panel/Menus/IndicatorMenuWindow.qml 2013-06-05 22:03:08 +0000 | |||
365 | +++ Panel/Menus/IndicatorMenuWindow.qml 1970-01-01 00:00:00 +0000 | |||
366 | @@ -1,35 +0,0 @@ | |||
367 | 1 | /* | ||
368 | 2 | * Copyright (C) 2013 Canonical, Ltd. | ||
369 | 3 | * | ||
370 | 4 | * This program is free software; you can redistribute it and/or modify | ||
371 | 5 | * it under the terms of the GNU General Public License as published by | ||
372 | 6 | * the Free Software Foundation; version 3. | ||
373 | 7 | * | ||
374 | 8 | * This program is distributed in the hope that it will be useful, | ||
375 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
376 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
377 | 11 | * GNU General Public License for more details. | ||
378 | 12 | * | ||
379 | 13 | * You should have received a copy of the GNU General Public License | ||
380 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
381 | 15 | */ | ||
382 | 16 | |||
383 | 17 | import QtQuick 2.0 | ||
384 | 18 | |||
385 | 19 | Item { | ||
386 | 20 | id: menuWindow | ||
387 | 21 | |||
388 | 22 | property bool shown: false | ||
389 | 23 | property int contentHeight: height | ||
390 | 24 | property string headingText: name | ||
391 | 25 | property string name | ||
392 | 26 | |||
393 | 27 | enabled: shown | ||
394 | 28 | opacity: shown ? 1.0 : 0.0 | ||
395 | 29 | Behavior on opacity { NumberAnimation {duration: shown ? 300 : 150 } } | ||
396 | 30 | |||
397 | 31 | // don't pass any events under this screen | ||
398 | 32 | MouseArea { | ||
399 | 33 | anchors.fill: parent | ||
400 | 34 | } | ||
401 | 35 | } | ||
402 | 36 | 0 | ||
403 | === removed directory 'Panel/Menus/Overview' | |||
404 | === removed file 'Panel/Menus/Overview.qml' | |||
405 | --- Panel/Menus/Overview.qml 2013-06-05 22:03:08 +0000 | |||
406 | +++ Panel/Menus/Overview.qml 1970-01-01 00:00:00 +0000 | |||
407 | @@ -1,70 +0,0 @@ | |||
408 | 1 | /* | ||
409 | 2 | * Copyright (C) 2013 Canonical, Ltd. | ||
410 | 3 | * | ||
411 | 4 | * This program is free software; you can redistribute it and/or modify | ||
412 | 5 | * it under the terms of the GNU General Public License as published by | ||
413 | 6 | * the Free Software Foundation; version 3. | ||
414 | 7 | * | ||
415 | 8 | * This program is distributed in the hope that it will be useful, | ||
416 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
417 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
418 | 11 | * GNU General Public License for more details. | ||
419 | 12 | * | ||
420 | 13 | * You should have received a copy of the GNU General Public License | ||
421 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
422 | 15 | */ | ||
423 | 16 | |||
424 | 17 | import QtQuick 2.0 | ||
425 | 18 | import Ubuntu.Components 0.1 | ||
426 | 19 | import "../../Components/ListItems" as ListItems | ||
427 | 20 | import "Overview" | ||
428 | 21 | |||
429 | 22 | IndicatorMenuWindow { | ||
430 | 23 | id: overview | ||
431 | 24 | |||
432 | 25 | property QtObject indicatorsModel: null | ||
433 | 26 | |||
434 | 27 | signal menuSelected(int modelIndex) | ||
435 | 28 | |||
436 | 29 | VisualItemModel { | ||
437 | 30 | id: itemModel | ||
438 | 31 | |||
439 | 32 | FlightModeWidget { | ||
440 | 33 | anchors { | ||
441 | 34 | left: parent ? parent.left : undefined | ||
442 | 35 | right: parent ? parent.right : undefined | ||
443 | 36 | } | ||
444 | 37 | height: units.gu(8) | ||
445 | 38 | |||
446 | 39 | ListItems.ThinDivider { | ||
447 | 40 | anchors { | ||
448 | 41 | bottom: parent.bottom | ||
449 | 42 | bottomMargin: -units.dp(1) | ||
450 | 43 | } | ||
451 | 44 | } | ||
452 | 45 | } | ||
453 | 46 | |||
454 | 47 | VolumeWidget { | ||
455 | 48 | anchors { | ||
456 | 49 | left: parent ? parent.left : undefined | ||
457 | 50 | right: parent ? parent.right : undefined | ||
458 | 51 | } | ||
459 | 52 | height: units.gu(10) | ||
460 | 53 | } | ||
461 | 54 | |||
462 | 55 | OverviewGrid { | ||
463 | 56 | model: indicatorsModel | ||
464 | 57 | anchors { | ||
465 | 58 | left: parent ? parent.left : undefined | ||
466 | 59 | right: parent ? parent.right : undefined | ||
467 | 60 | } | ||
468 | 61 | } | ||
469 | 62 | } | ||
470 | 63 | |||
471 | 64 | ListView { | ||
472 | 65 | id: listView | ||
473 | 66 | anchors.fill: parent | ||
474 | 67 | model: itemModel | ||
475 | 68 | interactive: false | ||
476 | 69 | } | ||
477 | 70 | } | ||
478 | 71 | 0 | ||
479 | === removed file 'Panel/Menus/Overview/FlightModeWidget.qml' | |||
480 | --- Panel/Menus/Overview/FlightModeWidget.qml 2013-07-17 10:34:41 +0000 | |||
481 | +++ Panel/Menus/Overview/FlightModeWidget.qml 1970-01-01 00:00:00 +0000 | |||
482 | @@ -1,60 +0,0 @@ | |||
483 | 1 | /* | ||
484 | 2 | * Copyright (C) 2013 Canonical, Ltd. | ||
485 | 3 | * | ||
486 | 4 | * This program is free software; you can redistribute it and/or modify | ||
487 | 5 | * it under the terms of the GNU General Public License as published by | ||
488 | 6 | * the Free Software Foundation; version 3. | ||
489 | 7 | * | ||
490 | 8 | * This program is distributed in the hope that it will be useful, | ||
491 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
492 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
493 | 11 | * GNU General Public License for more details. | ||
494 | 12 | * | ||
495 | 13 | * You should have received a copy of the GNU General Public License | ||
496 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
497 | 15 | */ | ||
498 | 16 | |||
499 | 17 | import QtQuick 2.0 | ||
500 | 18 | import Ubuntu.Components 0.1 | ||
501 | 19 | |||
502 | 20 | Item { | ||
503 | 21 | id: flightModeWidget | ||
504 | 22 | |||
505 | 23 | Image { | ||
506 | 24 | id: flightIcon | ||
507 | 25 | source: "graphics/plane_icon.png" | ||
508 | 26 | anchors { | ||
509 | 27 | left: parent.left | ||
510 | 28 | leftMargin: units.gu(2) | ||
511 | 29 | verticalCenter: parent.verticalCenter | ||
512 | 30 | } | ||
513 | 31 | width: units.gu(4) | ||
514 | 32 | height: units.gu(4) | ||
515 | 33 | } | ||
516 | 34 | |||
517 | 35 | Label { | ||
518 | 36 | anchors { | ||
519 | 37 | left: flightIcon.right | ||
520 | 38 | right: flightModeSwitch.left | ||
521 | 39 | margins: units.gu(2) | ||
522 | 40 | verticalCenter: parent.verticalCenter | ||
523 | 41 | } | ||
524 | 42 | text: i18n.tr("Flight mode") | ||
525 | 43 | color: Theme.palette.selected.backgroundText | ||
526 | 44 | style: Text.Raised | ||
527 | 45 | styleColor: "black" | ||
528 | 46 | opacity: 0.6; | ||
529 | 47 | fontSize: "medium" | ||
530 | 48 | elide: Text.ElideRight | ||
531 | 49 | horizontalAlignment: Text.AlignLeft | ||
532 | 50 | } | ||
533 | 51 | |||
534 | 52 | Switch { | ||
535 | 53 | id: flightModeSwitch | ||
536 | 54 | anchors { | ||
537 | 55 | right: parent.right | ||
538 | 56 | rightMargin: units.gu(2) | ||
539 | 57 | verticalCenter: parent.verticalCenter | ||
540 | 58 | } | ||
541 | 59 | } | ||
542 | 60 | } | ||
543 | 61 | 0 | ||
544 | === removed file 'Panel/Menus/Overview/OverviewGrid.qml' | |||
545 | --- Panel/Menus/Overview/OverviewGrid.qml 2013-07-17 11:03:15 +0000 | |||
546 | +++ Panel/Menus/Overview/OverviewGrid.qml 1970-01-01 00:00:00 +0000 | |||
547 | @@ -1,135 +0,0 @@ | |||
548 | 1 | /* | ||
549 | 2 | * Copyright (C) 2013 Canonical, Ltd. | ||
550 | 3 | * | ||
551 | 4 | * This program is free software; you can redistribute it and/or modify | ||
552 | 5 | * it under the terms of the GNU General Public License as published by | ||
553 | 6 | * the Free Software Foundation; version 3. | ||
554 | 7 | * | ||
555 | 8 | * This program is distributed in the hope that it will be useful, | ||
556 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
557 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
558 | 11 | * GNU General Public License for more details. | ||
559 | 12 | * | ||
560 | 13 | * You should have received a copy of the GNU General Public License | ||
561 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
562 | 15 | */ | ||
563 | 16 | |||
564 | 17 | import QtQuick 2.0 | ||
565 | 18 | import Ubuntu.Components 0.1 | ||
566 | 19 | |||
567 | 20 | import "../../../Components/ListItems" as ListItems | ||
568 | 21 | |||
569 | 22 | Item { | ||
570 | 23 | id: overviewGrid | ||
571 | 24 | |||
572 | 25 | height: childrenRect.height | ||
573 | 26 | |||
574 | 27 | property var model | ||
575 | 28 | |||
576 | 29 | UbuntuShape { | ||
577 | 30 | id: gridBackground | ||
578 | 31 | anchors.fill: grid | ||
579 | 32 | color: "#282421" // FIXME missing palette | ||
580 | 33 | radius: "medium" | ||
581 | 34 | } | ||
582 | 35 | |||
583 | 36 | GridView { | ||
584 | 37 | id: grid | ||
585 | 38 | objectName: "overviewGrid" | ||
586 | 39 | |||
587 | 40 | property int columnCount: 3 | ||
588 | 41 | property int rowCount: Math.ceil(model.count / columnCount) | ||
589 | 42 | |||
590 | 43 | anchors { | ||
591 | 44 | top: parent.top | ||
592 | 45 | left: parent.left | ||
593 | 46 | right: parent.right | ||
594 | 47 | topMargin: units.gu(3) | ||
595 | 48 | leftMargin: units.gu(2) | ||
596 | 49 | rightMargin: units.gu(2) | ||
597 | 50 | } | ||
598 | 51 | height: cellWidth * rowCount | ||
599 | 52 | cellWidth: Math.floor((width) / columnCount) | ||
600 | 53 | cellHeight: cellWidth | ||
601 | 54 | model: overviewGrid.model | ||
602 | 55 | visible: opacity != 0 | ||
603 | 56 | interactive: false | ||
604 | 57 | delegate: | ||
605 | 58 | AbstractButton { | ||
606 | 59 | objectName: "overviewGridButton" + index | ||
607 | 60 | width: grid.cellWidth | ||
608 | 61 | height: grid.cellHeight | ||
609 | 62 | |||
610 | 63 | Loader { | ||
611 | 64 | id: loader | ||
612 | 65 | source: widgetSource | ||
613 | 66 | |||
614 | 67 | width: units.gu(5) | ||
615 | 68 | height: units.gu(5) | ||
616 | 69 | anchors.centerIn: parent | ||
617 | 70 | anchors.verticalCenterOffset: -units.gu(1) | ||
618 | 71 | |||
619 | 72 | onLoaded: { | ||
620 | 73 | for(var pName in indicatorProperties) { | ||
621 | 74 | if (item.hasOwnProperty(pName)) { | ||
622 | 75 | item[pName] = indicatorProperties[pName] | ||
623 | 76 | } | ||
624 | 77 | } | ||
625 | 78 | } | ||
626 | 79 | } | ||
627 | 80 | |||
628 | 81 | Label { | ||
629 | 82 | text: title | ||
630 | 83 | color: Theme.palette.selected.backgroundText | ||
631 | 84 | fontSize: "small" | ||
632 | 85 | anchors { | ||
633 | 86 | left: parent.left | ||
634 | 87 | right: parent.right | ||
635 | 88 | bottom: parent.bottom | ||
636 | 89 | leftMargin: units.gu(0.5) | ||
637 | 90 | rightMargin: units.gu(0.5) | ||
638 | 91 | bottomMargin: units.gu(1.5) | ||
639 | 92 | } | ||
640 | 93 | elide: Text.ElideRight | ||
641 | 94 | horizontalAlignment: Text.AlignHCenter | ||
642 | 95 | |||
643 | 96 | } | ||
644 | 97 | onClicked: overview.menuSelected(index) | ||
645 | 98 | } | ||
646 | 99 | } | ||
647 | 100 | |||
648 | 101 | Item { | ||
649 | 102 | id: gridOverlay | ||
650 | 103 | anchors.fill: grid | ||
651 | 104 | |||
652 | 105 | Column { | ||
653 | 106 | anchors { | ||
654 | 107 | left: parent.left | ||
655 | 108 | right: parent.right | ||
656 | 109 | } | ||
657 | 110 | spacing: grid.cellHeight | ||
658 | 111 | y: grid.cellHeight - units.dp(1) | ||
659 | 112 | Repeater { | ||
660 | 113 | model: grid.rowCount - 1 | ||
661 | 114 | ListItems.ThinDivider { | ||
662 | 115 | anchors.margins: units.dp(1) | ||
663 | 116 | } | ||
664 | 117 | } | ||
665 | 118 | } | ||
666 | 119 | |||
667 | 120 | Row { | ||
668 | 121 | anchors { | ||
669 | 122 | top: parent.top | ||
670 | 123 | bottom: parent.bottom | ||
671 | 124 | } | ||
672 | 125 | spacing: grid.cellWidth - units.dp(1) | ||
673 | 126 | x: grid.cellWidth - units.dp(1) | ||
674 | 127 | Repeater { | ||
675 | 128 | model: grid.columnCount - 1 | ||
676 | 129 | ListItems.VerticalThinDivider { | ||
677 | 130 | anchors.margins: units.dp(1) | ||
678 | 131 | } | ||
679 | 132 | } | ||
680 | 133 | } | ||
681 | 134 | } | ||
682 | 135 | } | ||
683 | 136 | 0 | ||
684 | === removed file 'Panel/Menus/Overview/VolumeWidget.qml' | |||
685 | --- Panel/Menus/Overview/VolumeWidget.qml 2013-06-05 22:03:08 +0000 | |||
686 | +++ Panel/Menus/Overview/VolumeWidget.qml 1970-01-01 00:00:00 +0000 | |||
687 | @@ -1,88 +0,0 @@ | |||
688 | 1 | /* | ||
689 | 2 | * Copyright (C) 2013 Canonical, Ltd. | ||
690 | 3 | * | ||
691 | 4 | * This program is free software; you can redistribute it and/or modify | ||
692 | 5 | * it under the terms of the GNU General Public License as published by | ||
693 | 6 | * the Free Software Foundation; version 3. | ||
694 | 7 | * | ||
695 | 8 | * This program is distributed in the hope that it will be useful, | ||
696 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
697 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
698 | 11 | * GNU General Public License for more details. | ||
699 | 12 | * | ||
700 | 13 | * You should have received a copy of the GNU General Public License | ||
701 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
702 | 15 | */ | ||
703 | 16 | |||
704 | 17 | import QtQuick 2.0 | ||
705 | 18 | import Ubuntu.Components 0.1 | ||
706 | 19 | import "../../../Components/" | ||
707 | 20 | |||
708 | 21 | Item { | ||
709 | 22 | id: volumeWidget | ||
710 | 23 | |||
711 | 24 | Image { | ||
712 | 25 | id: minVolumeIcon | ||
713 | 26 | objectName: "minVolumeIcon" | ||
714 | 27 | source: "graphics/sound_off_icon.png" | ||
715 | 28 | anchors { | ||
716 | 29 | left: parent.left | ||
717 | 30 | leftMargin: units.gu(2) | ||
718 | 31 | verticalCenter: parent.verticalCenter | ||
719 | 32 | } | ||
720 | 33 | width: units.gu(4) | ||
721 | 34 | height: units.gu(4) | ||
722 | 35 | |||
723 | 36 | MouseArea { | ||
724 | 37 | anchors.fill: parent | ||
725 | 38 | onClicked: volumeControl.volumeDown(); | ||
726 | 39 | } | ||
727 | 40 | } | ||
728 | 41 | |||
729 | 42 | Slider { | ||
730 | 43 | id: slider | ||
731 | 44 | objectName: "volumeSlider" | ||
732 | 45 | anchors { | ||
733 | 46 | left: minVolumeIcon.right | ||
734 | 47 | right: maxVolumeIcon.left | ||
735 | 48 | margins: units.gu(1) | ||
736 | 49 | verticalCenter: parent.verticalCenter | ||
737 | 50 | } | ||
738 | 51 | live: false | ||
739 | 52 | minimumValue: 0 | ||
740 | 53 | maximumValue: 100 | ||
741 | 54 | value: 50 | ||
742 | 55 | |||
743 | 56 | onValueChanged: { | ||
744 | 57 | volumeControl.volume = value; | ||
745 | 58 | } | ||
746 | 59 | |||
747 | 60 | Binding { | ||
748 | 61 | target: slider | ||
749 | 62 | property: "value" | ||
750 | 63 | value: volumeControl.volume | ||
751 | 64 | } | ||
752 | 65 | |||
753 | 66 | function formatValue(v) { | ||
754 | 67 | return "" | ||
755 | 68 | } | ||
756 | 69 | } | ||
757 | 70 | |||
758 | 71 | Image { | ||
759 | 72 | id: maxVolumeIcon | ||
760 | 73 | objectName: "maxVolumeIcon" | ||
761 | 74 | source: "graphics/sound_on_icon.png" | ||
762 | 75 | anchors { | ||
763 | 76 | right: parent.right | ||
764 | 77 | rightMargin: units.gu(2) | ||
765 | 78 | verticalCenter: parent.verticalCenter | ||
766 | 79 | } | ||
767 | 80 | width: units.gu(4) | ||
768 | 81 | height: units.gu(4) | ||
769 | 82 | |||
770 | 83 | MouseArea { | ||
771 | 84 | anchors.fill: parent | ||
772 | 85 | onClicked: volumeControl.volumeUp(); | ||
773 | 86 | } | ||
774 | 87 | } | ||
775 | 88 | } | ||
776 | 89 | 0 | ||
777 | === removed directory 'Panel/Menus/Overview/graphics' | |||
778 | === removed file 'Panel/Menus/Overview/graphics/plane_icon@18.png' | |||
779 | 90 | Binary files Panel/Menus/Overview/graphics/plane_icon@18.png 2013-06-05 22:03:08 +0000 and Panel/Menus/Overview/graphics/plane_icon@18.png 1970-01-01 00:00:00 +0000 differ | 1 | Binary files Panel/Menus/Overview/graphics/plane_icon@18.png 2013-06-05 22:03:08 +0000 and Panel/Menus/Overview/graphics/plane_icon@18.png 1970-01-01 00:00:00 +0000 differ |
780 | === removed file 'Panel/Menus/Overview/graphics/sound_off_icon@18.png' | |||
781 | 91 | Binary files Panel/Menus/Overview/graphics/sound_off_icon@18.png 2013-06-05 22:03:08 +0000 and Panel/Menus/Overview/graphics/sound_off_icon@18.png 1970-01-01 00:00:00 +0000 differ | 2 | Binary files Panel/Menus/Overview/graphics/sound_off_icon@18.png 2013-06-05 22:03:08 +0000 and Panel/Menus/Overview/graphics/sound_off_icon@18.png 1970-01-01 00:00:00 +0000 differ |
782 | === removed file 'Panel/Menus/Overview/graphics/sound_on_icon@18.png' | |||
783 | 92 | Binary files Panel/Menus/Overview/graphics/sound_on_icon@18.png 2013-06-05 22:03:08 +0000 and Panel/Menus/Overview/graphics/sound_on_icon@18.png 1970-01-01 00:00:00 +0000 differ | 3 | Binary files Panel/Menus/Overview/graphics/sound_on_icon@18.png 2013-06-05 22:03:08 +0000 and Panel/Menus/Overview/graphics/sound_on_icon@18.png 1970-01-01 00:00:00 +0000 differ |
784 | === modified file 'tests/qmltests/CMakeLists.txt' | |||
785 | --- tests/qmltests/CMakeLists.txt 2013-07-11 09:09:20 +0000 | |||
786 | +++ tests/qmltests/CMakeLists.txt 2013-07-17 16:45:32 +0000 | |||
787 | @@ -61,10 +61,8 @@ | |||
788 | 61 | add_qml_test(Panel IndicatorRow) | 61 | add_qml_test(Panel IndicatorRow) |
789 | 62 | add_qml_test(Panel Indicators IMPORT_PATHS ${CMAKE_BINARY_DIR}/plugins ${qmltest_DEFAULT_IMPORT_PATHS}) | 62 | add_qml_test(Panel Indicators IMPORT_PATHS ${CMAKE_BINARY_DIR}/plugins ${qmltest_DEFAULT_IMPORT_PATHS}) |
790 | 63 | add_qml_test(Panel MenuContent) | 63 | add_qml_test(Panel MenuContent) |
791 | 64 | add_qml_test(Panel Overview) | ||
792 | 65 | add_qml_test(Panel Panel IMPORT_PATHS ${CMAKE_BINARY_DIR}/plugins ${qmltest_DEFAULT_IMPORT_PATHS}) | 64 | add_qml_test(Panel Panel IMPORT_PATHS ${CMAKE_BINARY_DIR}/plugins ${qmltest_DEFAULT_IMPORT_PATHS}) |
793 | 66 | add_qml_test(Panel SearchIndicator) | 65 | add_qml_test(Panel SearchIndicator) |
794 | 67 | add_qml_test(Panel/Menus IndicatorMenuWindow IMPORT_PATHS ${qmltest_DEFAULT_IMPORT_PATHS}) | ||
795 | 68 | add_qml_test(SideStage SideStage IMPORT_PATHS ${qmltest_DEFAULT_IMPORT_PATHS} | 66 | add_qml_test(SideStage SideStage IMPORT_PATHS ${qmltest_DEFAULT_IMPORT_PATHS} |
796 | 69 | ${CMAKE_BINARY_DIR}/tests/mocks | 67 | ${CMAKE_BINARY_DIR}/tests/mocks |
797 | 70 | ${CMAKE_BINARY_DIR}/plugins) | 68 | ${CMAKE_BINARY_DIR}/plugins) |
798 | 71 | 69 | ||
799 | === removed directory 'tests/qmltests/Panel/Menus' | |||
800 | === removed file 'tests/qmltests/Panel/Menus/tst_IndicatorMenuWindow.qml' | |||
801 | --- tests/qmltests/Panel/Menus/tst_IndicatorMenuWindow.qml 2013-06-05 22:03:08 +0000 | |||
802 | +++ tests/qmltests/Panel/Menus/tst_IndicatorMenuWindow.qml 1970-01-01 00:00:00 +0000 | |||
803 | @@ -1,68 +0,0 @@ | |||
804 | 1 | /* | ||
805 | 2 | * Copyright 2013 Canonical Ltd. | ||
806 | 3 | * | ||
807 | 4 | * This program is free software; you can redistribute it and/or modify | ||
808 | 5 | * it under the terms of the GNU General Public License as published by | ||
809 | 6 | * the Free Software Foundation; version 3. | ||
810 | 7 | * | ||
811 | 8 | * This program is distributed in the hope that it will be useful, | ||
812 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
813 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
814 | 11 | * GNU General Public License for more details. | ||
815 | 12 | * | ||
816 | 13 | * You should have received a copy of the GNU General Public License | ||
817 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
818 | 15 | */ | ||
819 | 16 | |||
820 | 17 | import QtQuick 2.0 | ||
821 | 18 | import QtTest 1.0 | ||
822 | 19 | import "../.." | ||
823 | 20 | import "../../../../Panel/Menus" | ||
824 | 21 | import Ubuntu.Components 0.1 | ||
825 | 22 | import Unity.Test 0.1 as UT | ||
826 | 23 | |||
827 | 24 | Item { | ||
828 | 25 | id: testIndicatorMenuWindowItem | ||
829 | 26 | width: units.gu(9) | ||
830 | 27 | height: units.gu(3) | ||
831 | 28 | |||
832 | 29 | MouseArea { | ||
833 | 30 | id: mouseArea | ||
834 | 31 | anchors.fill: parent | ||
835 | 32 | } | ||
836 | 33 | |||
837 | 34 | IndicatorMenuWindow { | ||
838 | 35 | id: indicatorMenuWindow | ||
839 | 36 | name: "TestIndicatorMenuWindow" | ||
840 | 37 | anchors.fill: parent | ||
841 | 38 | } | ||
842 | 39 | |||
843 | 40 | UT.UnityTestCase { | ||
844 | 41 | name: "IndicatorMenuWindow" | ||
845 | 42 | when: windowShown | ||
846 | 43 | |||
847 | 44 | function test_mouseEvent_data() { | ||
848 | 45 | return [ | ||
849 | 46 | {tag: "visible", shown: true, opacity: 1.0, mouseClicks: 0}, | ||
850 | 47 | {tag: "invisible", shown: false, opacity: 0.0, mouseClicks: 1}, | ||
851 | 48 | ] | ||
852 | 49 | } | ||
853 | 50 | |||
854 | 51 | function test_mouseEvent(data) { | ||
855 | 52 | indicatorMenuWindow.shown = data.shown | ||
856 | 53 | tryCompare(indicatorMenuWindow, "opacity", data.opacity) | ||
857 | 54 | |||
858 | 55 | clickedSpy.clear() | ||
859 | 56 | mouseClick(indicatorMenuWindow, indicatorMenuWindow.width / 2, | ||
860 | 57 | indicatorMenuWindow.height / 2) | ||
861 | 58 | compare(clickedSpy.count, data.mouseClicks, | ||
862 | 59 | "Check for Mouse event eating by indicatorMenuWindow failed") | ||
863 | 60 | } | ||
864 | 61 | } | ||
865 | 62 | |||
866 | 63 | SignalSpy { | ||
867 | 64 | id: clickedSpy | ||
868 | 65 | target: mouseArea | ||
869 | 66 | signalName: "clicked" | ||
870 | 67 | } | ||
871 | 68 | } | ||
872 | 69 | 0 | ||
873 | === modified file 'tests/qmltests/Panel/tst_IndicatorRow.qml' | |||
874 | --- tests/qmltests/Panel/tst_IndicatorRow.qml 2013-07-03 15:39:46 +0000 | |||
875 | +++ tests/qmltests/Panel/tst_IndicatorRow.qml 2013-07-17 16:45:32 +0000 | |||
876 | @@ -32,7 +32,6 @@ | |||
877 | 32 | 32 | ||
878 | 33 | function init_test() | 33 | function init_test() |
879 | 34 | { | 34 | { |
880 | 35 | indicatorRow.overviewActive = false; | ||
881 | 36 | indicatorRow.state = "initial"; | 35 | indicatorRow.state = "initial"; |
882 | 37 | indicatorRow.currentItem = null; | 36 | indicatorRow.currentItem = null; |
883 | 38 | } | 37 | } |
884 | @@ -241,18 +240,5 @@ | |||
885 | 241 | compare(get_indicator_item_at(3).dimmed, true, "Other indicators should dim when in locked state"); | 240 | compare(get_indicator_item_at(3).dimmed, true, "Other indicators should dim when in locked state"); |
886 | 242 | compare(get_indicator_item_at(4).dimmed, true, "Other indicators should dim when in locked state"); | 241 | compare(get_indicator_item_at(4).dimmed, true, "Other indicators should dim when in locked state"); |
887 | 243 | } | 242 | } |
888 | 244 | |||
889 | 245 | function test_active_overview() { | ||
890 | 246 | init_test(); | ||
891 | 247 | |||
892 | 248 | indicatorRow.overviewActive = true; | ||
893 | 249 | indicatorRow.state = "commit"; | ||
894 | 250 | |||
895 | 251 | compare(get_indicator_item_at(0).dimmed, true, "Indicator should dim when in overview"); | ||
896 | 252 | compare(get_indicator_item_at(1).dimmed, true, "Indicator should dim when in overview"); | ||
897 | 253 | compare(get_indicator_item_at(2).dimmed, true, "Indicator should dim when in overview"); | ||
898 | 254 | compare(get_indicator_item_at(3).dimmed, true, "Indicator should dim when in overview"); | ||
899 | 255 | compare(get_indicator_item_at(4).dimmed, true, "Indicator should dim when in overview"); | ||
900 | 256 | } | ||
901 | 257 | } | 243 | } |
902 | 258 | } | 244 | } |
903 | 259 | 245 | ||
904 | === modified file 'tests/qmltests/Panel/tst_Indicators.qml' | |||
905 | --- tests/qmltests/Panel/tst_Indicators.qml 2013-07-03 16:33:58 +0000 | |||
906 | +++ tests/qmltests/Panel/tst_Indicators.qml 2013-07-17 16:45:32 +0000 | |||
907 | @@ -69,7 +69,6 @@ | |||
908 | 69 | 69 | ||
909 | 70 | onClicked: { | 70 | onClicked: { |
910 | 71 | if (!indicators.shown) { | 71 | if (!indicators.shown) { |
911 | 72 | indicators.openOverview(); | ||
912 | 73 | indicators.show(); | 72 | indicators.show(); |
913 | 74 | } else { | 73 | } else { |
914 | 75 | indicators.hide(); | 74 | indicators.hide(); |
915 | @@ -89,47 +88,10 @@ | |||
916 | 89 | tryCompare(indicators, "state", "initial"); | 88 | tryCompare(indicators, "state", "initial"); |
917 | 90 | } | 89 | } |
918 | 91 | 90 | ||
920 | 92 | // Showing the indicators should fully open the indicator panel with the overview menu visible. | 91 | // Showing the indicators should fully open the indicator panel. |
921 | 93 | function test_show() { | 92 | function test_show() { |
922 | 94 | indicators.show() | 93 | indicators.show() |
923 | 95 | tryCompare(indicators, "fullyOpened", true); | 94 | tryCompare(indicators, "fullyOpened", true); |
924 | 96 | |||
925 | 97 | // A show must open the indicators. | ||
926 | 98 | compare(findChild(indicators, "indicatorRow").overviewActive, true, "Overview indicator should be active when opened overview.") | ||
927 | 99 | } | ||
928 | 100 | |||
929 | 101 | // Opening the overview menu will activate the overview panel. | ||
930 | 102 | function test_open_overview() { | ||
931 | 103 | indicators.openOverview(); | ||
932 | 104 | compare(findChild(indicators, "indicatorRow").overviewActive, true, "Overview should be active when opened overview.") | ||
933 | 105 | } | ||
934 | 106 | |||
935 | 107 | // Showing the indicators, then changing the progress (simulating drag) should keep the overview panel open until | ||
936 | 108 | // the reveal state is reached. | ||
937 | 109 | function test_slow_close_open_overview() { | ||
938 | 110 | |||
939 | 111 | var indicator_row = findChild(indicators, "indicatorRow"); | ||
940 | 112 | verify(indicator_row != undefined); | ||
941 | 113 | |||
942 | 114 | indicators.show() | ||
943 | 115 | // wait for animation to end. (progress needs to be updated) | ||
944 | 116 | tryCompare(indicators.showAnimation, "running", false); | ||
945 | 117 | compare(indicator_row.overviewActive, true, "Overview should be active when opened overview.") | ||
946 | 118 | |||
947 | 119 | // iteratively decrease the progress and ensure that it keeps the correct behaviour | ||
948 | 120 | var current_progress = indicators.progress - shell.height/20; | ||
949 | 121 | while (current_progress > 0) { | ||
950 | 122 | indicators.progress = current_progress; | ||
951 | 123 | |||
952 | 124 | if (indicators.state == "commit" || indicators.state == "locked") { | ||
953 | 125 | compare(indicator_row.overviewActive, true, "Overview should be active when in locked or commit state after show.") | ||
954 | 126 | } | ||
955 | 127 | else if (indicators.state == "reveal" || indicators.state == "hint") { | ||
956 | 128 | compare(indicator_row.overviewActive, false, "Overview should be not active when not in commit or locked state.") | ||
957 | 129 | } | ||
958 | 130 | |||
959 | 131 | current_progress = current_progress - shell.height/20; | ||
960 | 132 | } | ||
961 | 133 | } | 95 | } |
962 | 134 | 96 | ||
963 | 135 | // Test the change in the revealer lateral position changes the current panel menu to fit the position | 97 | // Test the change in the revealer lateral position changes the current panel menu to fit the position |
964 | 136 | 98 | ||
965 | === modified file 'tests/qmltests/Panel/tst_MenuContent.qml' | |||
966 | --- tests/qmltests/Panel/tst_MenuContent.qml 2013-06-17 08:14:24 +0000 | |||
967 | +++ tests/qmltests/Panel/tst_MenuContent.qml 2013-07-17 16:45:32 +0000 | |||
968 | @@ -52,8 +52,8 @@ | |||
969 | 52 | height: parent.height - 50 | 52 | height: parent.height - 50 |
970 | 53 | } | 53 | } |
971 | 54 | 54 | ||
974 | 55 | Item { | 55 | Rectangle { |
975 | 56 | id: click_me | 56 | color: "#bbbbbb" |
976 | 57 | 57 | ||
977 | 58 | height: 50 | 58 | height: 50 |
978 | 59 | anchors { | 59 | anchors { |
979 | @@ -62,50 +62,16 @@ | |||
980 | 62 | right: parent.right | 62 | right: parent.right |
981 | 63 | } | 63 | } |
982 | 64 | 64 | ||
1004 | 65 | Rectangle { | 65 | Text { |
1005 | 66 | color: "#999999" | 66 | text: "Next Indicator" |
1006 | 67 | 67 | anchors.fill: parent | |
1007 | 68 | anchors { | 68 | horizontalAlignment: Text.AlignHCenter |
1008 | 69 | top: parent.top | 69 | verticalAlignment: Text.AlignVCenter |
988 | 70 | left: parent.left | ||
989 | 71 | right: parent.horizontalCenter | ||
990 | 72 | bottom: parent.bottom | ||
991 | 73 | } | ||
992 | 74 | |||
993 | 75 | Text { | ||
994 | 76 | text: "Devices" | ||
995 | 77 | anchors.fill: parent | ||
996 | 78 | horizontalAlignment: Text.AlignHCenter | ||
997 | 79 | verticalAlignment: Text.AlignVCenter | ||
998 | 80 | } | ||
999 | 81 | |||
1000 | 82 | MouseArea { | ||
1001 | 83 | anchors.fill: parent | ||
1002 | 84 | onClicked: menuContent.showOverview() | ||
1003 | 85 | } | ||
1009 | 86 | } | 70 | } |
1010 | 87 | 71 | ||
1032 | 88 | Rectangle { | 72 | MouseArea { |
1033 | 89 | color: "#bbbbbb" | 73 | anchors.fill: parent |
1034 | 90 | 74 | onClicked: activate_next_content() | |
1014 | 91 | anchors { | ||
1015 | 92 | top: parent.top | ||
1016 | 93 | left: parent.horizontalCenter | ||
1017 | 94 | right: parent.right | ||
1018 | 95 | bottom: parent.bottom | ||
1019 | 96 | } | ||
1020 | 97 | |||
1021 | 98 | Text { | ||
1022 | 99 | text: "Next Indicator" | ||
1023 | 100 | anchors.fill: parent | ||
1024 | 101 | horizontalAlignment: Text.AlignHCenter | ||
1025 | 102 | verticalAlignment: Text.AlignVCenter | ||
1026 | 103 | } | ||
1027 | 104 | |||
1028 | 105 | MouseArea { | ||
1029 | 106 | anchors.fill: parent | ||
1030 | 107 | onClicked: activate_next_content() | ||
1031 | 108 | } | ||
1035 | 109 | } | 75 | } |
1036 | 110 | } | 76 | } |
1037 | 111 | 77 | ||
1038 | @@ -120,7 +86,6 @@ | |||
1039 | 120 | function activate_content(index) | 86 | function activate_content(index) |
1040 | 121 | { | 87 | { |
1041 | 122 | menuContent.currentIndex = index | 88 | menuContent.currentIndex = index |
1042 | 123 | menuContent.showMenu(); | ||
1043 | 124 | } | 89 | } |
1044 | 125 | 90 | ||
1045 | 126 | function get_test_menu_objecName(index) { | 91 | function get_test_menu_objecName(index) { |
1046 | @@ -151,7 +116,6 @@ | |||
1047 | 151 | when: windowShown | 116 | when: windowShown |
1048 | 152 | 117 | ||
1049 | 153 | function init() { | 118 | function init() { |
1050 | 154 | menuContent.hideAll(); | ||
1051 | 155 | if (menuContent.__contentActive) | 119 | if (menuContent.__contentActive) |
1052 | 156 | menuContent.releaseContent(); | 120 | menuContent.releaseContent(); |
1053 | 157 | tryCompare(menuContent, "__contentActive", false); | 121 | tryCompare(menuContent, "__contentActive", false); |
1054 | @@ -174,40 +138,6 @@ | |||
1055 | 174 | compare(menus.currentIndex, menu_index, "Current menu index does not match selected menu index"); | 138 | compare(menus.currentIndex, menu_index, "Current menu index does not match selected menu index"); |
1056 | 175 | tryCompareFunction(current_menu_equals_test_menu, true); | 139 | tryCompareFunction(current_menu_equals_test_menu, true); |
1057 | 176 | } | 140 | } |
1058 | 177 | // overview should not be visible. | ||
1059 | 178 | tryCompare(findChild(menuContent, "overview"), "visible", false); | ||
1060 | 179 | } | ||
1061 | 180 | |||
1062 | 181 | function test_show_overview() { | ||
1063 | 182 | menuContent.showOverview(); | ||
1064 | 183 | |||
1065 | 184 | var overview = findChild(menuContent, "overview"); | ||
1066 | 185 | tryCompare(overview, "visible", true); | ||
1067 | 186 | tryCompare(overview, "enabled", true); | ||
1068 | 187 | tryCompare(overview, "opacity", 1.0); | ||
1069 | 188 | |||
1070 | 189 | // menus should not be enabled. | ||
1071 | 190 | tryCompare(findChild(menuContent, "menus"), "opacity", 0); | ||
1072 | 191 | tryCompare(findChild(menuContent, "menus"), "enabled", false); | ||
1073 | 192 | } | ||
1074 | 193 | |||
1075 | 194 | function test_overview_menuSelected_signal() { | ||
1076 | 195 | menuContent.showOverview(); | ||
1077 | 196 | |||
1078 | 197 | var overview = findChild(menuContent, "overview"); | ||
1079 | 198 | var menus = menu_content_test.findChild(menuContent, "menus") | ||
1080 | 199 | |||
1081 | 200 | var menu_count = indicatorsModel.count; | ||
1082 | 201 | verify(menu_count > 0, "Menu count should be greater than zero"); | ||
1083 | 202 | for (var i = 0; i < menu_count; i++) { | ||
1084 | 203 | // manually emit signal from overview. | ||
1085 | 204 | // we dont want to go with mouse events here, otherwise we're testing the overview and not the signal. | ||
1086 | 205 | overview.menuSelected(i); | ||
1087 | 206 | |||
1088 | 207 | test_menu_objectName = get_test_menu_objecName(i); | ||
1089 | 208 | compare(menus.currentIndex, i, "Current menu index does not match selected menu index"); | ||
1090 | 209 | tryCompareFunction(current_menu_equals_test_menu, true); | ||
1091 | 210 | } | ||
1092 | 211 | } | 141 | } |
1093 | 212 | 142 | ||
1094 | 213 | // Calling activateContent should call start on all menus | 143 | // Calling activateContent should call start on all menus |
1095 | 214 | 144 | ||
1096 | === removed file 'tests/qmltests/Panel/tst_Overview.qml' | |||
1097 | --- tests/qmltests/Panel/tst_Overview.qml 2013-06-18 18:02:29 +0000 | |||
1098 | +++ tests/qmltests/Panel/tst_Overview.qml 1970-01-01 00:00:00 +0000 | |||
1099 | @@ -1,142 +0,0 @@ | |||
1100 | 1 | /* | ||
1101 | 2 | * Copyright 2013 Canonical Ltd. | ||
1102 | 3 | * | ||
1103 | 4 | * This program is free software; you can redistribute it and/or modify | ||
1104 | 5 | * it under the terms of the GNU General Public License as published by | ||
1105 | 6 | * the Free Software Foundation; version 3. | ||
1106 | 7 | * | ||
1107 | 8 | * This program is distributed in the hope that it will be useful, | ||
1108 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
1109 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
1110 | 11 | * GNU General Public License for more details. | ||
1111 | 12 | * | ||
1112 | 13 | * You should have received a copy of the GNU General Public License | ||
1113 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
1114 | 15 | */ | ||
1115 | 16 | |||
1116 | 17 | import QtQuick 2.0 | ||
1117 | 18 | import QtTest 1.0 | ||
1118 | 19 | import ".." | ||
1119 | 20 | import "../../../Panel/Menus" | ||
1120 | 21 | import "../../../Components" | ||
1121 | 22 | import Unity.Test 0.1 as UT | ||
1122 | 23 | import Unity.Indicators 0.1 as Indicators | ||
1123 | 24 | |||
1124 | 25 | Rectangle { | ||
1125 | 26 | id: shell | ||
1126 | 27 | width: units.gu(40) | ||
1127 | 28 | height: units.gu(80) | ||
1128 | 29 | color: "black" | ||
1129 | 30 | |||
1130 | 31 | Overview { | ||
1131 | 32 | id: overview | ||
1132 | 33 | anchors.fill: parent | ||
1133 | 34 | indicatorsModel: mockModel | ||
1134 | 35 | shown: true | ||
1135 | 36 | } | ||
1136 | 37 | |||
1137 | 38 | Item { | ||
1138 | 39 | id: volumeControl | ||
1139 | 40 | property int volume | ||
1140 | 41 | function volumeUp() { | ||
1141 | 42 | volume = Math.min(100, volume + 10); | ||
1142 | 43 | } | ||
1143 | 44 | function volumeDown() { | ||
1144 | 45 | volume = Math.max(0, volume - 10); | ||
1145 | 46 | } | ||
1146 | 47 | } | ||
1147 | 48 | |||
1148 | 49 | ListModel { | ||
1149 | 50 | id: mockModel | ||
1150 | 51 | ListElement {title: "fake1"; widgetSource: "qrc:/tests/indciators/qml/fake_menu_widget1.qml"; indicatorProperties: ""} | ||
1151 | 52 | ListElement {title: "fake2"; widgetSource: "qrc:/tests/indciators/qml/fake_menu_widget2.qml"; indicatorProperties: ""} | ||
1152 | 53 | ListElement {title: "fake3"; widgetSource: "qrc:/tests/indciators/qml/fake_menu_widget3.qml"; indicatorProperties: ""} | ||
1153 | 54 | } | ||
1154 | 55 | |||
1155 | 56 | ListModel { | ||
1156 | 57 | id: mockModel2 | ||
1157 | 58 | } | ||
1158 | 59 | |||
1159 | 60 | SignalSpy { | ||
1160 | 61 | id: clickSpy | ||
1161 | 62 | target: overview | ||
1162 | 63 | signalName: "menuSelected" | ||
1163 | 64 | } | ||
1164 | 65 | |||
1165 | 66 | UT.UnityTestCase { | ||
1166 | 67 | name: "Overview" | ||
1167 | 68 | when: windowShown | ||
1168 | 69 | |||
1169 | 70 | function initTestCase() { | ||
1170 | 71 | // Spin the event loop once because the UI builds up delayed | ||
1171 | 72 | wait(0); | ||
1172 | 73 | } | ||
1173 | 74 | |||
1174 | 75 | function test_menuSelected() { | ||
1175 | 76 | overview.indicatorsModel = mockModel; | ||
1176 | 77 | |||
1177 | 78 | for (var i = 0; i < mockModel.count; ++i) { | ||
1178 | 79 | var button = findChild(overview, "overviewGridButton" + i); | ||
1179 | 80 | clickSpy.clear(); | ||
1180 | 81 | mouseClick(button, button.width / 2, button.height / 2); | ||
1181 | 82 | compare(clickSpy.count, 1, "Clicking on grid didn't work"); | ||
1182 | 83 | compare(clickSpy.signalArguments[0][0], i, "Clicking the grid returned a wrong index"); | ||
1183 | 84 | } | ||
1184 | 85 | } | ||
1185 | 86 | |||
1186 | 87 | function test_dynamic_addition() { | ||
1187 | 88 | var overviewGrid = findChild(overview, "overviewGrid"); | ||
1188 | 89 | |||
1189 | 90 | for(var i = 0; i < mockModel.count; ++i) { | ||
1190 | 91 | mockModel2.append(mockModel.get(i)); | ||
1191 | 92 | } | ||
1192 | 93 | overview.indicatorsModel = mockModel2; | ||
1193 | 94 | overviewGrid.forceLayout(); | ||
1194 | 95 | waitForRendering(overviewGrid); | ||
1195 | 96 | |||
1196 | 97 | var button = findChild(overview, "overviewGridButton2"); | ||
1197 | 98 | verify(button !== undefined, "button2 wasn't found"); | ||
1198 | 99 | button = findChild(overview, "overviewGridButton3"); | ||
1199 | 100 | compare(button, undefined, "There should only be 3 buttons... found at least 4..."); | ||
1200 | 101 | |||
1201 | 102 | mockModel2.append({title: "humppa", widgetSource: "qrc:/tests/indciators/qml/fake_menu_widget4.qml", indicatorProperties: ""}) | ||
1202 | 103 | overviewGrid.forceLayout(); | ||
1203 | 104 | waitForRendering(overviewGrid); | ||
1204 | 105 | |||
1205 | 106 | button = findChild(overview, "overviewGridButton3"); | ||
1206 | 107 | verify(button !== undefined, "button3 wasn't found"); | ||
1207 | 108 | } | ||
1208 | 109 | |||
1209 | 110 | function test_volume_slider_data() { | ||
1210 | 111 | return [ | ||
1211 | 112 | {tag: "0%", sliderPos:0}, | ||
1212 | 113 | {tag: "100%", sliderPos: 100}, | ||
1213 | 114 | {tag: "50%", sliderPos: 50} | ||
1214 | 115 | ]; | ||
1215 | 116 | } | ||
1216 | 117 | |||
1217 | 118 | function test_volume_slider(data) { | ||
1218 | 119 | var volumeSlider = findChild(overview, "volumeSlider"); | ||
1219 | 120 | var startX = volumeSlider.width * volumeSlider.value / 100; | ||
1220 | 121 | var startY = volumeSlider.y + volumeSlider.height / 2; | ||
1221 | 122 | var stopX = (volumeSlider.width - units.gu(5)) * data.sliderPos / 100; | ||
1222 | 123 | var stopY = volumeSlider.y + volumeSlider.height / 2; | ||
1223 | 124 | mouseFlick(volumeSlider, startX, startY, stopX, stopY, true, true, 0.1); | ||
1224 | 125 | } | ||
1225 | 126 | |||
1226 | 127 | function test_volume_buttons(data) { | ||
1227 | 128 | var volumeDownButton = findChild(overview, "minVolumeIcon"); | ||
1228 | 129 | var volumeUpButton = findChild(overview, "maxVolumeIcon"); | ||
1229 | 130 | |||
1230 | 131 | for (var i = 0; i < 10; ++i) { | ||
1231 | 132 | mouseClick(volumeDownButton, volumeDownButton.width / 2, volumeDownButton.height / 2); | ||
1232 | 133 | wait(0) | ||
1233 | 134 | } | ||
1234 | 135 | tryCompare(volumeControl, "volume", 0); | ||
1235 | 136 | for (var i = 0; i < 10; ++i) { | ||
1236 | 137 | mouseClick(volumeUpButton, 1, 1); | ||
1237 | 138 | wait(0) | ||
1238 | 139 | } | ||
1239 | 140 | } | ||
1240 | 141 | } | ||
1241 | 142 | } | ||
1242 | 143 | 0 | ||
1243 | === modified file 'tests/qmltests/Panel/tst_Panel.qml' | |||
1244 | --- tests/qmltests/Panel/tst_Panel.qml 2013-07-03 16:33:58 +0000 | |||
1245 | +++ tests/qmltests/Panel/tst_Panel.qml 2013-07-17 16:45:32 +0000 | |||
1246 | @@ -62,14 +62,14 @@ | |||
1247 | 62 | 62 | ||
1248 | 63 | function get_indicator_item(index) { | 63 | function get_indicator_item(index) { |
1249 | 64 | var row_repeater = findChild(panel.indicators, "rowRepeater"); | 64 | var row_repeater = findChild(panel.indicators, "rowRepeater"); |
1251 | 65 | verify(row_repeater != undefined) | 65 | verify(row_repeater != undefined); |
1252 | 66 | return row_repeater.itemAt(index); | 66 | return row_repeater.itemAt(index); |
1253 | 67 | } | 67 | } |
1254 | 68 | 68 | ||
1255 | 69 | function get_indicator_item_position(index) { | 69 | function get_indicator_item_position(index) { |
1256 | 70 | 70 | ||
1257 | 71 | var indicator_row = findChild(panel.indicators, "indicatorRow"); | 71 | var indicator_row = findChild(panel.indicators, "indicatorRow"); |
1259 | 72 | verify(indicator_row != undefined) | 72 | verify(indicator_row != undefined); |
1260 | 73 | 73 | ||
1261 | 74 | var indicator_item = get_indicator_item(index); | 74 | var indicator_item = get_indicator_item(index); |
1262 | 75 | verify(indicator_item != undefined); | 75 | verify(indicator_item != undefined); |
1263 | @@ -83,11 +83,11 @@ | |||
1264 | 83 | panel.fullscreenMode = false; | 83 | panel.fullscreenMode = false; |
1265 | 84 | // Wait for the indicators to get into position. | 84 | // Wait for the indicators to get into position. |
1266 | 85 | // (switches between normal and fullscreen modes are animated) | 85 | // (switches between normal and fullscreen modes are animated) |
1268 | 86 | tryCompare(panel.indicators, "y", 0) | 86 | tryCompare(panel.indicators, "y", 0); |
1269 | 87 | 87 | ||
1270 | 88 | var indicator_item_coord = get_indicator_item_position(0); | 88 | var indicator_item_coord = get_indicator_item_position(0); |
1271 | 89 | 89 | ||
1273 | 90 | touchPress(panel, indicator_item_coord.x, panel.panelHeight / 2) | 90 | touchPress(panel, indicator_item_coord.x, panel.panelHeight / 2); |
1274 | 91 | 91 | ||
1275 | 92 | // hint animation should be run, meaning that indicators will move downwards | 92 | // hint animation should be run, meaning that indicators will move downwards |
1276 | 93 | // by hintValue pixels without any drag taking place | 93 | // by hintValue pixels without any drag taking place |
1277 | @@ -96,7 +96,7 @@ | |||
1278 | 96 | tryCompare(panel.indicators, "partiallyOpened", true); | 96 | tryCompare(panel.indicators, "partiallyOpened", true); |
1279 | 97 | tryCompare(panel.indicators, "fullyOpened", false); | 97 | tryCompare(panel.indicators, "fullyOpened", false); |
1280 | 98 | 98 | ||
1282 | 99 | touchRelease(panel, indicator_item_coord.x, panel.panelHeight/2) | 99 | touchRelease(panel, indicator_item_coord.x, panel.panelHeight/2); |
1283 | 100 | } | 100 | } |
1284 | 101 | 101 | ||
1285 | 102 | // Pressing on the top edge of the screen should have no effect if the panel | 102 | // Pressing on the top edge of the screen should have no effect if the panel |
1286 | @@ -105,31 +105,31 @@ | |||
1287 | 105 | panel.fullscreenMode = true; | 105 | panel.fullscreenMode = true; |
1288 | 106 | // Wait for the indicators to get into position. | 106 | // Wait for the indicators to get into position. |
1289 | 107 | // (switches between normal and fullscreen modes are animated) | 107 | // (switches between normal and fullscreen modes are animated) |
1291 | 108 | tryCompare(panel.indicators, "y", -panel.panelHeight) | 108 | tryCompare(panel.indicators, "y", -panel.panelHeight); |
1292 | 109 | 109 | ||
1293 | 110 | var indicator_item_coord = get_indicator_item_position(0); | 110 | var indicator_item_coord = get_indicator_item_position(0); |
1294 | 111 | 111 | ||
1296 | 112 | touchPress(panel, indicator_item_coord.x, panel.panelHeight / 2) | 112 | touchPress(panel, indicator_item_coord.x, panel.panelHeight / 2); |
1297 | 113 | 113 | ||
1298 | 114 | // Give some time for a hint animation to change things, if any | 114 | // Give some time for a hint animation to change things, if any |
1300 | 115 | wait(500) | 115 | wait(500); |
1301 | 116 | 116 | ||
1302 | 117 | // no hint animation when fullscreen | 117 | // no hint animation when fullscreen |
1304 | 118 | compare(panel.indicators.y, -panel.panelHeight) | 118 | compare(panel.indicators.y, -panel.panelHeight); |
1305 | 119 | var indicatorRow = findChild(panel.indicators, "indicatorRow"); | 119 | var indicatorRow = findChild(panel.indicators, "indicatorRow"); |
1309 | 120 | verify(indicatorRow != undefined) | 120 | verify(indicatorRow != undefined); |
1310 | 121 | compare(indicatorRow.y, 0) | 121 | compare(indicatorRow.y, 0); |
1311 | 122 | compare(panel.indicators.height, panel.indicators.panelHeight) | 122 | compare(panel.indicators.height, panel.indicators.panelHeight); |
1312 | 123 | compare(panel.indicators.partiallyOpened, false, | 123 | compare(panel.indicators.partiallyOpened, false, |
1313 | 124 | "Indicator should not be partially opened when panel is pressed in" + | 124 | "Indicator should not be partially opened when panel is pressed in" + |
1315 | 125 | " fullscreenmode") | 125 | " fullscreenmode"); |
1316 | 126 | compare(panel.indicators.fullyOpened, false, "Indicator should not be partially" + | 126 | compare(panel.indicators.fullyOpened, false, "Indicator should not be partially" + |
1318 | 127 | " opened when panel is pressed in fullscreenmode") | 127 | " opened when panel is pressed in fullscreenmode"); |
1319 | 128 | 128 | ||
1321 | 129 | touchRelease(panel, indicator_item_coord.x, panel.panelHeight/2) | 129 | touchRelease(panel, indicator_item_coord.x, panel.panelHeight/2); |
1322 | 130 | } | 130 | } |
1323 | 131 | 131 | ||
1325 | 132 | function test_drag_show_data() { return get_window_data() } | 132 | function test_drag_show_data() { return get_window_data(); } |
1326 | 133 | 133 | ||
1327 | 134 | // Dragging from a indicator item in the panel will gradually expose the | 134 | // Dragging from a indicator item in the panel will gradually expose the |
1328 | 135 | // indicators, first by running the hint animation, then after dragging down will | 135 | // indicators, first by running the hint animation, then after dragging down will |
1329 | @@ -138,50 +138,50 @@ | |||
1330 | 138 | panel.fullscreenMode = data.fullscreenFlag; | 138 | panel.fullscreenMode = data.fullscreenFlag; |
1331 | 139 | 139 | ||
1332 | 140 | var indicator_row = findChild(panel.indicators, "indicatorRow"); | 140 | var indicator_row = findChild(panel.indicators, "indicatorRow"); |
1334 | 141 | verify(indicator_row != undefined) | 141 | verify(indicator_row != undefined); |
1335 | 142 | 142 | ||
1336 | 143 | var row_repeater = findChild(panel.indicators, "rowRepeater"); | 143 | var row_repeater = findChild(panel.indicators, "rowRepeater"); |
1338 | 144 | verify(indicator_row != undefined) | 144 | verify(indicator_row != undefined); |
1339 | 145 | 145 | ||
1340 | 146 | var menu_content = findChild(panel.indicators, "menuContent"); | 146 | var menu_content = findChild(panel.indicators, "menuContent"); |
1342 | 147 | verify(indicator_row != undefined) | 147 | verify(indicator_row != undefined); |
1343 | 148 | 148 | ||
1344 | 149 | // Wait for the indicators to get into position. | 149 | // Wait for the indicators to get into position. |
1345 | 150 | // (switches between normal and fullscreen modes are animated) | 150 | // (switches between normal and fullscreen modes are animated) |
1346 | 151 | if (data.fullscreenFlag) { | 151 | if (data.fullscreenFlag) { |
1348 | 152 | tryCompare(panel.indicators, "y", -panel.panelHeight) | 152 | tryCompare(panel.indicators, "y", -panel.panelHeight); |
1349 | 153 | } else { | 153 | } else { |
1351 | 154 | tryCompare(panel.indicators, "y", 0) | 154 | tryCompare(panel.indicators, "y", 0); |
1352 | 155 | } | 155 | } |
1353 | 156 | 156 | ||
1354 | 157 | // do this for each indicator item | 157 | // do this for each indicator item |
1355 | 158 | for (var i = 0; i < row_repeater.count; i++) { | 158 | for (var i = 0; i < row_repeater.count; i++) { |
1356 | 159 | 159 | ||
1357 | 160 | var indicator_item = get_indicator_item(i); | 160 | var indicator_item = get_indicator_item(i); |
1359 | 161 | verify(indicator_item != undefined) | 161 | verify(indicator_item != undefined); |
1360 | 162 | 162 | ||
1361 | 163 | var indicator_item_coord = get_indicator_item_position(i); | 163 | var indicator_item_coord = get_indicator_item_position(i); |
1362 | 164 | 164 | ||
1363 | 165 | touchPress(panel, | 165 | touchPress(panel, |
1365 | 166 | indicator_item_coord.x, panel.panelHeight / 2) | 166 | indicator_item_coord.x, panel.panelHeight / 2); |
1366 | 167 | 167 | ||
1367 | 168 | // 1) Drag the mouse down | 168 | // 1) Drag the mouse down |
1368 | 169 | touchFlick(panel, | 169 | touchFlick(panel, |
1369 | 170 | indicator_item_coord.x, panel.panelHeight / 2, | 170 | indicator_item_coord.x, panel.panelHeight / 2, |
1370 | 171 | indicator_item_coord.x, panel.height * 0.8, | 171 | indicator_item_coord.x, panel.height * 0.8, |
1372 | 172 | false /* beginTouch */, false /* endTouch */) | 172 | false /* beginTouch */, false /* endTouch */); |
1373 | 173 | 173 | ||
1374 | 174 | // Indicators height should follow the drag, and therefore increase accordingly. | 174 | // Indicators height should follow the drag, and therefore increase accordingly. |
1375 | 175 | // They should be at least half-way through the screen | 175 | // They should be at least half-way through the screen |
1376 | 176 | tryCompareFunction( | 176 | tryCompareFunction( |
1377 | 177 | function() {return panel.indicators.height >= panel.height * 0.5}, | 177 | function() {return panel.indicators.height >= panel.height * 0.5}, |
1379 | 178 | true) | 178 | true); |
1380 | 179 | 179 | ||
1382 | 180 | touchRelease(panel, indicator_item_coord.x, panel.height * 0.8) | 180 | touchRelease(panel, indicator_item_coord.x, panel.height * 0.8); |
1383 | 181 | 181 | ||
1384 | 182 | compare(indicator_row.currentItem, indicator_item, | 182 | compare(indicator_row.currentItem, indicator_item, |
1387 | 183 | "Incorrect item activated at position " + i) | 183 | "Incorrect item activated at position " + i); |
1388 | 184 | compare(menu_content.__shown, true, "Menu conetent should be enabled for item at position " + i); | 184 | compare(menu_content.currentIndex, i, "Menu conetent should be enabled for item at position " + i); |
1389 | 185 | 185 | ||
1390 | 186 | // init for next indicator_item | 186 | // init for next indicator_item |
1391 | 187 | init(); | 187 | init(); |
1392 | @@ -195,23 +195,23 @@ | |||
1393 | 195 | var search_indicator = findChild(panel, "search"); | 195 | var search_indicator = findChild(panel, "search"); |
1394 | 196 | verify(search_indicator != undefined); | 196 | verify(search_indicator != undefined); |
1395 | 197 | 197 | ||
1397 | 198 | tap(search_indicator, 1, 1) | 198 | tap(search_indicator, 1, 1); |
1398 | 199 | 199 | ||
1399 | 200 | compare(search_clicked, true, | 200 | compare(search_clicked, true, |
1401 | 201 | "Tapping search indicator while it was enabled did not emit searchClicked signal") | 201 | "Tapping search indicator while it was enabled did not emit searchClicked signal"); |
1402 | 202 | } | 202 | } |
1403 | 203 | 203 | ||
1404 | 204 | function test_search_click_when_not_visible() { | 204 | function test_search_click_when_not_visible() { |
1405 | 205 | panel.fullscreenMode = false; | 205 | panel.fullscreenMode = false; |
1407 | 206 | panel.searchVisible = false | 206 | panel.searchVisible = false; |
1408 | 207 | 207 | ||
1409 | 208 | var search_indicator = findChild(panel, "search"); | 208 | var search_indicator = findChild(panel, "search"); |
1410 | 209 | verify(search_indicator != undefined); | 209 | verify(search_indicator != undefined); |
1411 | 210 | 210 | ||
1413 | 211 | tap(search_indicator, 1, 1) | 211 | tap(search_indicator, 1, 1); |
1414 | 212 | 212 | ||
1415 | 213 | compare(search_clicked, false, | 213 | compare(search_clicked, false, |
1417 | 214 | "Tapping search indicator while it was not visible emitted searchClicked signal") | 214 | "Tapping search indicator while it was not visible emitted searchClicked signal"); |
1418 | 215 | } | 215 | } |
1419 | 216 | } | 216 | } |
1420 | 217 | } | 217 | } |
FAILED: Continuous integration, rev:116 jenkins. qa.ubuntu. com/job/ unity8- ci/301/ jenkins. qa.ubuntu. com/job/ generic- mediumtests- saucy/1205 jenkins. qa.ubuntu. com/job/ unity-phablet- qmluitests- saucy/656 jenkins. qa.ubuntu. com/job/ unity8- saucy-armhf- ci/300/ console jenkins. qa.ubuntu. com/job/ unity8- saucy-i386- ci/301 jenkins. qa.ubuntu. com/job/ generic- mediumtests- builder- saucy/1209 jenkins. qa.ubuntu. com/job/ generic- mediumtests- builder- saucy/1209/ artifact/ work/output/ *zip*/output. zip jenkins. qa.ubuntu. com/job/ generic- mediumtests- runner- saucy/1030
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild: s-jenkins: 8080/job/ unity8- ci/301/ rebuild
http://