Merge lp:~nick-dedekind/unity8/lp1264678-indicator.misalignment into lp:unity8
- lp1264678-indicator.misalignment
- Merge into trunk
Status: | Merged |
---|---|
Approved by: | MichaĆ Sawicz |
Approved revision: | 624 |
Merged at revision: | 640 |
Proposed branch: | lp:~nick-dedekind/unity8/lp1264678-indicator.misalignment |
Merge into: | lp:unity8 |
Diff against target: |
517 lines (+183/-100) 10 files modified
qml/Panel/IndicatorRow.qml (+51/-29) qml/Panel/Indicators.qml (+46/-34) qml/Panel/MenuContent.qml (+2/-2) tests/mocks/Unity/Indicators/IndicatorsModel.qml (+2/-5) tests/mocks/Unity/Indicators/qml/fake_menu_widget2.qml (+1/-3) tests/mocks/Unity/Indicators/qml/fake_menu_widget3.qml (+1/-1) tests/qmltests/Panel/tst_IndicatorRow.qml (+2/-1) tests/qmltests/Panel/tst_Indicators.qml (+62/-11) tests/qmltests/Panel/tst_MenuContent.qml (+2/-2) tests/qmltests/Panel/tst_Panel.qml (+14/-12) |
To merge this branch: | bzr merge lp:~nick-dedekind/unity8/lp1264678-indicator.misalignment |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
PS Jenkins bot (community) | continuous-integration | Approve | |
Albert Astals Cid (community) | Approve | ||
Review via email: mp+200866@code.launchpad.net |
Commit message
Fixes visible indicator misalignment in indicator items/menus (lp#1264678)
Description of the change
Fixes visible indicator misalignment in indicator items/menus (lp#1264678)
PS Jenkins bot (ps-jenkins) wrote : | # |
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:619
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Nick Dedekind (nick-dedekind) wrote : | # |
Most of this is to resolve some binding loops.
Fix is:
116 + onDataChanged: tabs.selectedTa
117 + onRowsInserted: tabs.selectedTa
118 + onRowsRemoved: tabs.selectedTa
Albert Astals Cid (aacid) wrote : | # |
As discussed in IRC Nick is
<dednick> but i think IndicatorRow should probably be doing the updating and notifying the MenuContent.
<dednick> investigating it :) i'll try work on a unit test as well
Albert Astals Cid (aacid) wrote : | # |
Putting a "Needs Fixing" just to mark this is waiting some work from Nick
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:622
http://
Executed test runs:
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Albert Astals Cid (aacid) wrote : | # |
If i unlock and then press with the mouse over the Messaging icon and don't move at all i get http://
Can you reproduce? Is this something we can fix?
Albert Astals Cid (aacid) wrote : | # |
I actually meant "Is this something we can test?" instead of "Is this something we can fix?" :D
Nick Dedekind (nick-dedekind) wrote : | # |
> If i unlock and then press with the mouse over the Messaging icon and don't
> move at all i get http://
>
> Can you reproduce? Is this something we can fix?
This is a bug in the SDK
https:/
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:622
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Albert Astals Cid (aacid) wrote : | # |
Needs remerging
Text conflict in tests/qmltests/
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:624
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Albert Astals Cid (aacid) wrote : | # |
Looks good to me
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Autolanding.
More details in the following jenkins job:
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Autolanding.
More details in the following jenkins job:
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Autolanding.
More details in the following jenkins job:
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Autolanding.
More details in the following jenkins job:
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
PS Jenkins bot (ps-jenkins) : | # |
Preview Diff
1 | === modified file 'qml/Panel/IndicatorRow.qml' | |||
2 | --- qml/Panel/IndicatorRow.qml 2014-01-10 13:48:13 +0000 | |||
3 | +++ qml/Panel/IndicatorRow.qml 2014-01-15 11:27:34 +0000 | |||
4 | @@ -26,7 +26,7 @@ | |||
5 | 26 | readonly property int currentItemIndex: currentItem ? currentItem.ownIndex : -1 | 26 | readonly property int currentItemIndex: currentItem ? currentItem.ownIndex : -1 |
6 | 27 | property alias row: row | 27 | property alias row: row |
7 | 28 | property QtObject indicatorsModel: null | 28 | property QtObject indicatorsModel: null |
9 | 29 | property var visibleIndicators: defined | 29 | property var visibleIndicators: undefined |
10 | 30 | property int overFlowWidth: width | 30 | property int overFlowWidth: width |
11 | 31 | property bool showAll: false | 31 | property bool showAll: false |
12 | 32 | property real currentItemOffset: 0.0 | 32 | property real currentItemOffset: 0.0 |
13 | @@ -94,34 +94,56 @@ | |||
14 | 94 | property real opacityMultiplier: highlighted ? 1 : (1 - indicatorRow.unitProgress) | 94 | property real opacityMultiplier: highlighted ? 1 : (1 - indicatorRow.unitProgress) |
15 | 95 | 95 | ||
16 | 96 | IndicatorItem { | 96 | IndicatorItem { |
45 | 97 | id: indicatorItem | 97 | id: indicatorItem |
46 | 98 | identifier: model.identifier | 98 | identifier: model.identifier |
47 | 99 | height: parent.height | 99 | height: parent.height |
48 | 100 | 100 | ||
49 | 101 | dimmed: itemWrapper.dimmed | 101 | dimmed: itemWrapper.dimmed |
50 | 102 | 102 | ||
51 | 103 | widgetSource: model.widgetSource | 103 | widgetSource: model.widgetSource |
52 | 104 | indicatorProperties : model.indicatorProperties | 104 | indicatorProperties : model.indicatorProperties |
53 | 105 | 105 | ||
54 | 106 | Component.onCompleted: { | 106 | Component.onCompleted: { |
55 | 107 | if (visibleIndicators == undefined) { | 107 | updateVisiblility(); |
56 | 108 | visibleIndicators = {} | 108 | } |
57 | 109 | } | 109 | onIndicatorVisibleChanged: { |
58 | 110 | indicatorRow.visibleIndicators[model.identifier] = indicatorVisible; | 110 | updateVisiblility(); |
59 | 111 | indicatorRow.visibleIndicatorsChanged(); | 111 | |
60 | 112 | } | 112 | if (indicatorVisible) { |
61 | 113 | onIndicatorVisibleChanged: { | 113 | showAll = true; |
62 | 114 | if (visibleIndicators == undefined) { | 114 | allVisible.start(); |
63 | 115 | visibleIndicators = {} | 115 | } |
64 | 116 | } | 116 | } |
65 | 117 | indicatorRow.visibleIndicators[model.identifier] = indicatorVisible; | 117 | |
66 | 118 | indicatorRow.visibleIndicatorsChanged(); | 118 | function updateVisiblility() { |
67 | 119 | 119 | if (visibleIndicators == undefined) { | |
68 | 120 | if (indicatorVisible) { | 120 | visibleIndicators = {} |
69 | 121 | showAll = true; | 121 | } |
70 | 122 | allVisible.start(); | 122 | indicatorRow.visibleIndicators[model.identifier] = indicatorVisible; |
71 | 123 | } | 123 | |
72 | 124 | } | 124 | // removed current index? |
73 | 125 | if (indicatorRow.currentItemIndex === index && !indicatorVisible) { | ||
74 | 126 | // find the next closest visible indicator (after current, else before) | ||
75 | 127 | var newIndex = -1; | ||
76 | 128 | for (var i = index+1; i < rowRepeater.count; i++) { | ||
77 | 129 | if (indicatorRow.visibleIndicators[i] === undefined || indicatorRow.visibleIndicators[model.identifier]) { | ||
78 | 130 | newIndex = i; | ||
79 | 131 | break; | ||
80 | 132 | } | ||
81 | 133 | } | ||
82 | 134 | if (newIndex === -1) { | ||
83 | 135 | for (i = index - 1; i >= 0; i--) { | ||
84 | 136 | if (indicatorRow.visibleIndicators[i] === undefined || indicatorRow.visibleIndicators[model.identifier]) { | ||
85 | 137 | newIndex = i; | ||
86 | 138 | break; | ||
87 | 139 | } | ||
88 | 140 | } | ||
89 | 141 | } | ||
90 | 142 | indicatorRow.setCurrentItem(newIndex); | ||
91 | 143 | } | ||
92 | 144 | |||
93 | 145 | indicatorRow.visibleIndicatorsChanged(); | ||
94 | 146 | } | ||
95 | 125 | } | 147 | } |
96 | 126 | 148 | ||
97 | 127 | states: [ | 149 | states: [ |
98 | 128 | 150 | ||
99 | === modified file 'qml/Panel/Indicators.qml' | |||
100 | --- qml/Panel/Indicators.qml 2014-01-06 10:26:03 +0000 | |||
101 | +++ qml/Panel/Indicators.qml 2014-01-15 11:27:34 +0000 | |||
102 | @@ -193,21 +193,6 @@ | |||
103 | 193 | clip: !indicators.fullyOpened | 193 | clip: !indicators.fullyOpened |
104 | 194 | activeHeader: indicators.state == "hint" || indicators.state == "reveal" | 194 | activeHeader: indicators.state == "hint" || indicators.state == "reveal" |
105 | 195 | enabled: contentEnabled | 195 | enabled: contentEnabled |
106 | 196 | visibleIndicators: indicatorRow.visibleIndicators | ||
107 | 197 | |||
108 | 198 | Connections { | ||
109 | 199 | property bool enableIndexChangeSignal: true | ||
110 | 200 | |||
111 | 201 | target: enableIndexChangeSignal ? indicatorRow : null | ||
112 | 202 | onCurrentItemIndexChanged: { | ||
113 | 203 | var oldActive = enableIndexChangeSignal; | ||
114 | 204 | enableIndexChangeSignal = false; | ||
115 | 205 | |||
116 | 206 | menuContent.setCurrentMenuIndex(indicatorRow.currentItemIndex); | ||
117 | 207 | |||
118 | 208 | enableIndexChangeSignal = oldActive; | ||
119 | 209 | } | ||
120 | 210 | } | ||
121 | 211 | 196 | ||
122 | 212 | //small shadow gradient at bottom of menu | 197 | //small shadow gradient at bottom of menu |
123 | 213 | Rectangle { | 198 | Rectangle { |
124 | @@ -263,8 +248,6 @@ | |||
125 | 263 | 248 | ||
126 | 264 | Indicators.IndicatorsModel { | 249 | Indicators.IndicatorsModel { |
127 | 265 | id: indicatorsModel | 250 | id: indicatorsModel |
128 | 266 | |||
129 | 267 | Component.onCompleted: load() | ||
130 | 268 | } | 251 | } |
131 | 269 | 252 | ||
132 | 270 | IndicatorRow { | 253 | IndicatorRow { |
133 | @@ -279,17 +262,11 @@ | |||
134 | 279 | state: indicators.state | 262 | state: indicators.state |
135 | 280 | unitProgress: indicators.unitProgress | 263 | unitProgress: indicators.unitProgress |
136 | 281 | 264 | ||
148 | 282 | Connections { | 265 | onVisibleIndicatorsChanged: { |
149 | 283 | property bool enableIndexChangeSignal: true | 266 | // need to do it here so we can control sequence |
150 | 284 | 267 | if (visibleIndicators !== undefined) { | |
151 | 285 | target: enableIndexChangeSignal ? menuContent : null | 268 | menuContent.visibleIndicators = visibleIndicators; |
152 | 286 | onCurrentMenuIndexChanged: { | 269 | menuContent.setCurrentMenuIndex(currentItemIndex); |
142 | 287 | var oldActive = enableIndexChangeSignal; | ||
143 | 288 | enableIndexChangeSignal = false; | ||
144 | 289 | |||
145 | 290 | indicatorRow.setCurrentItem(menuContent.currentMenuIndex); | ||
146 | 291 | |||
147 | 292 | enableIndexChangeSignal = oldActive; | ||
153 | 293 | } | 270 | } |
154 | 294 | } | 271 | } |
155 | 295 | 272 | ||
156 | @@ -341,15 +318,45 @@ | |||
157 | 341 | } | 318 | } |
158 | 342 | } | 319 | } |
159 | 343 | 320 | ||
161 | 344 | property var activeDragHandle: showDragHandle.dragging ? showDragHandle : hideDragHandle.dragging ? hideDragHandle : null | 321 | QtObject { |
162 | 322 | id: d | ||
163 | 323 | property bool enableIndexChangeSignal: true | ||
164 | 324 | property var activeDragHandle: showDragHandle.dragging ? showDragHandle : hideDragHandle.dragging ? hideDragHandle : null | ||
165 | 325 | } | ||
166 | 326 | |||
167 | 327 | Connections { | ||
168 | 328 | target: menuContent | ||
169 | 329 | onCurrentMenuIndexChanged: { | ||
170 | 330 | var oldActive = d.enableIndexChangeSignal; | ||
171 | 331 | if (!oldActive) return; | ||
172 | 332 | d.enableIndexChangeSignal = false; | ||
173 | 333 | |||
174 | 334 | indicatorRow.setCurrentItem(menuContent.currentMenuIndex); | ||
175 | 335 | |||
176 | 336 | d.enableIndexChangeSignal = oldActive; | ||
177 | 337 | } | ||
178 | 338 | } | ||
179 | 339 | |||
180 | 340 | Connections { | ||
181 | 341 | target: indicatorRow | ||
182 | 342 | onCurrentItemIndexChanged: { | ||
183 | 343 | var oldActive = d.enableIndexChangeSignal; | ||
184 | 344 | if (!oldActive) return; | ||
185 | 345 | d.enableIndexChangeSignal = false; | ||
186 | 346 | |||
187 | 347 | menuContent.setCurrentMenuIndex(indicatorRow.currentItemIndex); | ||
188 | 348 | |||
189 | 349 | d.enableIndexChangeSignal = oldActive; | ||
190 | 350 | } | ||
191 | 351 | } | ||
192 | 345 | // connections to the active drag handle | 352 | // connections to the active drag handle |
193 | 346 | Connections { | 353 | Connections { |
195 | 347 | target: activeDragHandle | 354 | target: d.activeDragHandle |
196 | 348 | onTouchXChanged: { | 355 | onTouchXChanged: { |
198 | 349 | indicators.calculateCurrentItem(activeDragHandle.touchX, true); | 356 | indicators.calculateCurrentItem(d.activeDragHandle.touchX, true); |
199 | 350 | } | 357 | } |
200 | 351 | onTouchSceneYChanged: { | 358 | onTouchSceneYChanged: { |
202 | 352 | yVelocityCalculator.trackedPosition = activeDragHandle.touchSceneY; | 359 | yVelocityCalculator.trackedPosition = d.activeDragHandle.touchSceneY; |
203 | 353 | } | 360 | } |
204 | 354 | } | 361 | } |
205 | 355 | 362 | ||
206 | @@ -403,8 +410,8 @@ | |||
207 | 403 | } | 410 | } |
208 | 404 | StateChangeScript { | 411 | StateChangeScript { |
209 | 405 | script: { | 412 | script: { |
212 | 406 | if (activeDragHandle) { | 413 | if (d.activeDragHandle) { |
213 | 407 | calculateCurrentItem(activeDragHandle.touchX, false); | 414 | calculateCurrentItem(d.activeDragHandle.touchX, false); |
214 | 408 | } | 415 | } |
215 | 409 | } | 416 | } |
216 | 410 | } | 417 | } |
217 | @@ -429,4 +436,9 @@ | |||
218 | 429 | NumberAnimation {targets: [indicatorRow, menuContent]; property: "y"; duration: 300; easing.type: Easing.OutCubic} | 436 | NumberAnimation {targets: [indicatorRow, menuContent]; property: "y"; duration: 300; easing.type: Easing.OutCubic} |
219 | 430 | } | 437 | } |
220 | 431 | ] | 438 | ] |
221 | 439 | |||
222 | 440 | Component.onCompleted: initialise(); | ||
223 | 441 | function initialise() { | ||
224 | 442 | indicatorsModel.load(); | ||
225 | 443 | } | ||
226 | 432 | } | 444 | } |
227 | 433 | 445 | ||
228 | === modified file 'qml/Panel/MenuContent.qml' | |||
229 | --- qml/Panel/MenuContent.qml 2014-01-06 10:26:03 +0000 | |||
230 | +++ qml/Panel/MenuContent.qml 2014-01-15 11:27:34 +0000 | |||
231 | @@ -39,10 +39,10 @@ | |||
232 | 39 | height: units.gu(42) | 39 | height: units.gu(42) |
233 | 40 | 40 | ||
234 | 41 | function setCurrentMenuIndex(index) { | 41 | function setCurrentMenuIndex(index) { |
236 | 42 | var filteredIndex = filteredIndicators.mapFromSource(index) | 42 | var filteredIndex = filteredIndicators.mapFromSource(index); |
237 | 43 | 43 | ||
238 | 44 | if (tabs.selectedTabIndex !== filteredIndex) { | 44 | if (tabs.selectedTabIndex !== filteredIndex) { |
240 | 45 | if (tabs.selectedTabIndex == -1 || !animateNextMenuChange) { | 45 | if (tabs.selectedTabIndex === -1 || !animateNextMenuChange) { |
241 | 46 | tabs.tabBar.animate = false; | 46 | tabs.tabBar.animate = false; |
242 | 47 | } | 47 | } |
243 | 48 | tabs.selectedTabIndex = filteredIndex; | 48 | tabs.selectedTabIndex = filteredIndex; |
244 | 49 | 49 | ||
245 | === modified file 'tests/mocks/Unity/Indicators/IndicatorsModel.qml' | |||
246 | --- tests/mocks/Unity/Indicators/IndicatorsModel.qml 2013-09-17 12:31:19 +0000 | |||
247 | +++ tests/mocks/Unity/Indicators/IndicatorsModel.qml 2014-01-15 11:27:34 +0000 | |||
248 | @@ -21,12 +21,9 @@ | |||
249 | 21 | 21 | ||
250 | 22 | property var indicatorData : undefined | 22 | property var indicatorData : undefined |
251 | 23 | 23 | ||
253 | 24 | function load() {} | 24 | function load() { |
254 | 25 | clear(); | ||
255 | 25 | 26 | ||
256 | 26 | // Need to do this dynamically. | ||
257 | 27 | // Apparently ListModels dont order roles visually when using ListElement | ||
258 | 28 | // which throws off the filter for non-visible indicators. | ||
259 | 29 | Component.onCompleted: { | ||
260 | 30 | append({ "identifier": "indicator-fake1", | 27 | append({ "identifier": "indicator-fake1", |
261 | 31 | "position": 0, | 28 | "position": 0, |
262 | 32 | "widgetSource": "qrc:/tests/indciators/qml/fake_menu_widget1.qml", | 29 | "widgetSource": "qrc:/tests/indciators/qml/fake_menu_widget1.qml", |
263 | 33 | 30 | ||
264 | === modified file 'tests/mocks/Unity/Indicators/qml/fake_menu_widget2.qml' | |||
265 | --- tests/mocks/Unity/Indicators/qml/fake_menu_widget2.qml 2013-08-22 18:37:09 +0000 | |||
266 | +++ tests/mocks/Unity/Indicators/qml/fake_menu_widget2.qml 2014-01-15 11:27:34 +0000 | |||
267 | @@ -19,7 +19,5 @@ | |||
268 | 19 | Rectangle { | 19 | Rectangle { |
269 | 20 | width: 40 | 20 | width: 40 |
270 | 21 | height: 40 | 21 | height: 40 |
274 | 22 | color : "yellow" | 22 | color : "blue" |
272 | 23 | |||
273 | 24 | enabled: false | ||
275 | 25 | } | 23 | } |
276 | 26 | 24 | ||
277 | === modified file 'tests/mocks/Unity/Indicators/qml/fake_menu_widget3.qml' | |||
278 | --- tests/mocks/Unity/Indicators/qml/fake_menu_widget3.qml 2013-06-17 09:02:14 +0000 | |||
279 | +++ tests/mocks/Unity/Indicators/qml/fake_menu_widget3.qml 2014-01-15 11:27:34 +0000 | |||
280 | @@ -19,5 +19,5 @@ | |||
281 | 19 | Rectangle { | 19 | Rectangle { |
282 | 20 | width: 40 | 20 | width: 40 |
283 | 21 | height: 40 | 21 | height: 40 |
285 | 22 | color : "blue" | 22 | color : "yellow" |
286 | 23 | } | 23 | } |
287 | 24 | 24 | ||
288 | === modified file 'tests/qmltests/Panel/tst_IndicatorRow.qml' | |||
289 | --- tests/qmltests/Panel/tst_IndicatorRow.qml 2014-01-07 14:29:23 +0000 | |||
290 | +++ tests/qmltests/Panel/tst_IndicatorRow.qml 2014-01-15 11:27:34 +0000 | |||
291 | @@ -32,6 +32,8 @@ | |||
292 | 32 | 32 | ||
293 | 33 | function init_test() | 33 | function init_test() |
294 | 34 | { | 34 | { |
295 | 35 | indicatorModel.load(); | ||
296 | 36 | |||
297 | 35 | indicatorRow.state = "initial"; | 37 | indicatorRow.state = "initial"; |
298 | 36 | indicatorRow.currentItem = null; | 38 | indicatorRow.currentItem = null; |
299 | 37 | indicatorRow.unitProgress = 0.0; | 39 | indicatorRow.unitProgress = 0.0; |
300 | @@ -53,7 +55,6 @@ | |||
301 | 53 | 55 | ||
302 | 54 | Indicators.IndicatorsModel { | 56 | Indicators.IndicatorsModel { |
303 | 55 | id: indicatorModel | 57 | id: indicatorModel |
304 | 56 | Component.onCompleted: load() | ||
305 | 57 | } | 58 | } |
306 | 58 | 59 | ||
307 | 59 | UT.UnityTestCase { | 60 | UT.UnityTestCase { |
308 | 60 | 61 | ||
309 | === modified file 'tests/qmltests/Panel/tst_Indicators.qml' | |||
310 | --- tests/qmltests/Panel/tst_Indicators.qml 2014-01-15 08:36:33 +0000 | |||
311 | +++ tests/qmltests/Panel/tst_Indicators.qml 2014-01-15 11:27:34 +0000 | |||
312 | @@ -83,6 +83,8 @@ | |||
313 | 83 | when: windowShown | 83 | when: windowShown |
314 | 84 | 84 | ||
315 | 85 | function init() { | 85 | function init() { |
316 | 86 | indicators.initialise(); | ||
317 | 87 | |||
318 | 86 | indicators.hide(); | 88 | indicators.hide(); |
319 | 87 | tryCompare(indicators.hideAnimation, "running", false); | 89 | tryCompare(indicators.hideAnimation, "running", false); |
320 | 88 | tryCompare(indicators, "state", "initial"); | 90 | tryCompare(indicators, "state", "initial"); |
321 | @@ -161,21 +163,70 @@ | |||
322 | 161 | compare(indicators.fullyOpened, true); | 163 | compare(indicators.fullyOpened, true); |
323 | 162 | } | 164 | } |
324 | 163 | 165 | ||
325 | 166 | function init_invisible_indicator(identifier) { | ||
326 | 167 | tryCompareFunction(function() { return findChild(indicators, identifier+"-widget") !== null }, true); | ||
327 | 168 | var item = findChild(indicators, identifier+"-widget"); | ||
328 | 169 | |||
329 | 170 | item.enabled = false; | ||
330 | 171 | } | ||
331 | 172 | |||
332 | 164 | function test_row_visible_menuContent_visible_data() { return [ | 173 | function test_row_visible_menuContent_visible_data() { return [ |
335 | 165 | {tag: "visible", index: 0, name: "indicator-fake1", visible: true }, | 174 | {tag: "first", visible: [false, true, true, true, true] }, |
336 | 166 | {tag: "invisible", index: 1, name: "indicator-fake2", visible: false }] | 175 | {tag: "adjacent", visible: [true, false, false, true, true] }, |
337 | 176 | {tag: "bounds", visible: [false, true, true, true, false] }, | ||
338 | 177 | {tag: "disjoint", visible: [true, false, true, false, true] }, | ||
339 | 178 | {tag: "last", visible: [true, true, true, true, false] }]; | ||
340 | 167 | } | 179 | } |
341 | 168 | 180 | ||
342 | 169 | function test_row_visible_menuContent_visible(data) { | 181 | function test_row_visible_menuContent_visible(data) { |
352 | 170 | var indicatorTabs = findChild(indicators, "tabs"); | 182 | |
353 | 171 | var rowRepeater = findChild(indicators, "rowRepeater"); | 183 | indicators.show(); |
354 | 172 | 184 | ||
355 | 173 | var indicatorItem = rowRepeater.itemAt(data.index); | 185 | var indicatorTabs = findChild(indicators, "tabs"); |
356 | 174 | tryCompareFunction(function() { return indicatorItem.width > 0}, true); | 186 | var rowRepeater = findChild(indicators, "rowRepeater") |
357 | 175 | tryCompare(indicatorItem, "visible", data.visible); | 187 | |
358 | 176 | 188 | ||
359 | 177 | var indicatorTab = findChild(indicatorTabs, data.name) | 189 | for (var i = 0; i< data.visible.length; i++) { |
360 | 178 | tryCompareFunction(function() { return indicatorTab !== null }, data.visible); | 190 | if (data.visible[i] === false) |
361 | 191 | init_invisible_indicator("indicator-fake" + (i + 1)); | ||
362 | 192 | } | ||
363 | 193 | |||
364 | 194 | for (i = 0; i < data.visible.length; i++) { | ||
365 | 195 | var shouldBeVisible = data.visible[i]; | ||
366 | 196 | |||
367 | 197 | // check item visibility | ||
368 | 198 | var indicatorItem = rowRepeater.itemAt(i); | ||
369 | 199 | tryCompare(indicatorItem, "visible", shouldBeVisible); | ||
370 | 200 | // check tab visibility | ||
371 | 201 | tryCompareFunction(function() { return findChild(indicatorTabs, "indicator-fake" + (i + 1)) !== null }, shouldBeVisible); | ||
372 | 202 | } | ||
373 | 203 | } | ||
374 | 204 | |||
375 | 205 | function test_indicator_visible_correct_tabs_data() { return [ | ||
376 | 206 | {tag: "current-first", currentIndex: 0, visible: [false, true, true, true, true], expected: 1 }, | ||
377 | 207 | {tag: "current-last", currentIndex: 4, visible: [true, true, true, true, false], expected: 3 }, | ||
378 | 208 | {tag: "after", currentIndex: 0, visible: [true, false, true, true, true], expected: 0 }, | ||
379 | 209 | {tag: "before", currentIndex: 1, visible: [false, true, true, true, true], expected: 1 }]; | ||
380 | 210 | } | ||
381 | 211 | |||
382 | 212 | function test_indicator_visible_correct_tabs(data) { | ||
383 | 213 | |||
384 | 214 | var indicatorTabs = findChild(indicators, "tabs"); | ||
385 | 215 | var indicatorRow = findChild(indicators, "indicatorRow"); | ||
386 | 216 | |||
387 | 217 | indicators.show(); | ||
388 | 218 | indicatorRow.setCurrentItem(data.currentIndex); | ||
389 | 219 | tryCompare(indicators, "fullyOpened", true); | ||
390 | 220 | |||
391 | 221 | for (var i = 0; i< data.visible.length; i++) { | ||
392 | 222 | if (data.visible[i] === false) | ||
393 | 223 | init_invisible_indicator("indicator-fake" + (i + 1)); | ||
394 | 224 | } | ||
395 | 225 | |||
396 | 226 | // check for current selected item | ||
397 | 227 | tryCompare(indicatorRow, "currentItemIndex", data.expected); | ||
398 | 228 | // check for current selected tab | ||
399 | 229 | tryCompareFunction(function() { return findChild(indicatorTabs, "indicator-fake" + (data.expected + 1)) === indicatorTabs.selectedTab }, true); | ||
400 | 179 | } | 230 | } |
401 | 180 | } | 231 | } |
402 | 181 | } | 232 | } |
403 | 182 | 233 | ||
404 | === modified file 'tests/qmltests/Panel/tst_MenuContent.qml' | |||
405 | --- tests/qmltests/Panel/tst_MenuContent.qml 2013-12-17 16:04:47 +0000 | |||
406 | +++ tests/qmltests/Panel/tst_MenuContent.qml 2014-01-15 11:27:34 +0000 | |||
407 | @@ -103,13 +103,13 @@ | |||
408 | 103 | 103 | ||
409 | 104 | function selected_tab_equals_test_tab() { | 104 | function selected_tab_equals_test_tab() { |
410 | 105 | var currentTab = menu_content_test.findChild(menuContent, "tabs").selectedTab | 105 | var currentTab = menu_content_test.findChild(menuContent, "tabs").selectedTab |
412 | 106 | if (currentTab == undefined) { | 106 | if (currentTab === null) { |
413 | 107 | console.log("selected tab undefined"); | 107 | console.log("selected tab undefined"); |
414 | 108 | return false; | 108 | return false; |
415 | 109 | } | 109 | } |
416 | 110 | 110 | ||
417 | 111 | var testTab = menu_content_test.findChild(menuContent, testTabObjectName); | 111 | var testTab = menu_content_test.findChild(menuContent, testTabObjectName); |
419 | 112 | if (testTab == undefined) { | 112 | if (testTab === null) { |
420 | 113 | console.log("test_tab " + testTabObjectName + " undefined"); | 113 | console.log("test_tab " + testTabObjectName + " undefined"); |
421 | 114 | return false; | 114 | return false; |
422 | 115 | } | 115 | } |
423 | 116 | 116 | ||
424 | === modified file 'tests/qmltests/Panel/tst_Panel.qml' | |||
425 | --- tests/qmltests/Panel/tst_Panel.qml 2013-12-17 16:04:47 +0000 | |||
426 | +++ tests/qmltests/Panel/tst_Panel.qml 2014-01-15 11:27:34 +0000 | |||
427 | @@ -56,6 +56,8 @@ | |||
428 | 56 | } | 56 | } |
429 | 57 | 57 | ||
430 | 58 | function init() { | 58 | function init() { |
431 | 59 | panel.indicators.initialise(); | ||
432 | 60 | |||
433 | 59 | searchClicked = false; | 61 | searchClicked = false; |
434 | 60 | panel.indicators.hide(); | 62 | panel.indicators.hide(); |
435 | 61 | tryCompare(panel.indicators.hideAnimation, "running", false); | 63 | tryCompare(panel.indicators.hideAnimation, "running", false); |
436 | @@ -64,16 +66,16 @@ | |||
437 | 64 | 66 | ||
438 | 65 | function get_indicator_item(index) { | 67 | function get_indicator_item(index) { |
439 | 66 | var rowRepeater = findChild(panel.indicators, "rowRepeater"); | 68 | var rowRepeater = findChild(panel.indicators, "rowRepeater"); |
441 | 67 | verify(rowRepeater != undefined); | 69 | verify(rowRepeater !== null); |
442 | 68 | return rowRepeater.itemAt(index); | 70 | return rowRepeater.itemAt(index); |
443 | 69 | } | 71 | } |
444 | 70 | 72 | ||
445 | 71 | function get_indicator_item_position(index) { | 73 | function get_indicator_item_position(index) { |
446 | 72 | var indicatorRow = findChild(panel.indicators, "indicatorRow"); | 74 | var indicatorRow = findChild(panel.indicators, "indicatorRow"); |
448 | 73 | verify(indicatorRow != undefined); | 75 | verify(indicatorRow !== null); |
449 | 74 | 76 | ||
450 | 75 | var indicatorItem = get_indicator_item(index); | 77 | var indicatorItem = get_indicator_item(index); |
452 | 76 | verify(indicatorItem != undefined); | 78 | verify(indicatorItem !== null); |
453 | 77 | 79 | ||
454 | 78 | return panel.mapFromItem(indicatorItem, indicatorItem.width/2, indicatorItem.height/2); | 80 | return panel.mapFromItem(indicatorItem, indicatorItem.width/2, indicatorItem.height/2); |
455 | 79 | } | 81 | } |
456 | @@ -118,7 +120,7 @@ | |||
457 | 118 | // no hint animation when fullscreen | 120 | // no hint animation when fullscreen |
458 | 119 | compare(panel.indicators.y, -panel.panelHeight); | 121 | compare(panel.indicators.y, -panel.panelHeight); |
459 | 120 | var indicatorRow = findChild(panel.indicators, "indicatorRow"); | 122 | var indicatorRow = findChild(panel.indicators, "indicatorRow"); |
461 | 121 | verify(indicatorRow != undefined); | 123 | verify(indicatorRow !== null); |
462 | 122 | compare(indicatorRow.y, 0); | 124 | compare(indicatorRow.y, 0); |
463 | 123 | compare(panel.indicators.height, panel.indicators.panelHeight); | 125 | compare(panel.indicators.height, panel.indicators.panelHeight); |
464 | 124 | compare(panel.indicators.partiallyOpened, false, | 126 | compare(panel.indicators.partiallyOpened, false, |
465 | @@ -143,13 +145,13 @@ | |||
466 | 143 | } | 145 | } |
467 | 144 | 146 | ||
468 | 145 | var indicatorRow = findChild(panel.indicators, "indicatorRow"); | 147 | var indicatorRow = findChild(panel.indicators, "indicatorRow"); |
470 | 146 | verify(indicatorRow != undefined); | 148 | verify(indicatorRow !== null); |
471 | 147 | 149 | ||
472 | 148 | var rowRepeater = findChild(panel.indicators, "rowRepeater"); | 150 | var rowRepeater = findChild(panel.indicators, "rowRepeater"); |
474 | 149 | verify(indicatorRow != undefined); | 151 | verify(indicatorRow !== null); |
475 | 150 | 152 | ||
476 | 151 | var menuContent = findChild(panel.indicators, "menuContent"); | 153 | var menuContent = findChild(panel.indicators, "menuContent"); |
478 | 152 | verify(indicatorRow != undefined); | 154 | verify(indicatorRow !== null); |
479 | 153 | 155 | ||
480 | 154 | // Wait for the indicators to get into position. | 156 | // Wait for the indicators to get into position. |
481 | 155 | // (switches between normal and fullscreen modes are animated) | 157 | // (switches between normal and fullscreen modes are animated) |
482 | @@ -203,7 +205,7 @@ | |||
483 | 203 | panel.searchVisible = true; | 205 | panel.searchVisible = true; |
484 | 204 | 206 | ||
485 | 205 | var searchIndicator = findChild(panel, "search"); | 207 | var searchIndicator = findChild(panel, "search"); |
487 | 206 | verify(searchIndicator != undefined); | 208 | verify(searchIndicator !== null); |
488 | 207 | 209 | ||
489 | 208 | tap(searchIndicator, 1, 1); | 210 | tap(searchIndicator, 1, 1); |
490 | 209 | 211 | ||
491 | @@ -216,7 +218,7 @@ | |||
492 | 216 | panel.searchVisible = false; | 218 | panel.searchVisible = false; |
493 | 217 | 219 | ||
494 | 218 | var searchIndicator = findChild(panel, "search"); | 220 | var searchIndicator = findChild(panel, "search"); |
496 | 219 | verify(searchIndicator != undefined); | 221 | verify(searchIndicator !== null); |
497 | 220 | 222 | ||
498 | 221 | tap(searchIndicator, 1, 1); | 223 | tap(searchIndicator, 1, 1); |
499 | 222 | 224 | ||
500 | @@ -232,14 +234,14 @@ | |||
501 | 232 | panel.searchVisible = false; | 234 | panel.searchVisible = false; |
502 | 233 | 235 | ||
503 | 234 | var indicatorRow = findChild(panel.indicators, "indicatorRow"); | 236 | var indicatorRow = findChild(panel.indicators, "indicatorRow"); |
505 | 235 | verify(indicatorRow != undefined); | 237 | verify(indicatorRow !== null); |
506 | 236 | 238 | ||
507 | 237 | var rowRepeater = findChild(panel.indicators, "rowRepeater"); | 239 | var rowRepeater = findChild(panel.indicators, "rowRepeater"); |
509 | 238 | verify(indicatorRow != undefined); | 240 | verify(indicatorRow !== null); |
510 | 239 | 241 | ||
511 | 240 | // Get the first indicator | 242 | // Get the first indicator |
512 | 241 | var indicatorItemFirst = get_indicator_item(0); | 243 | var indicatorItemFirst = get_indicator_item(0); |
514 | 242 | verify(indicatorItemFirst != undefined); | 244 | verify(indicatorItemFirst !== undefined); |
515 | 243 | 245 | ||
516 | 244 | var indicatorItemCoordFirst = get_indicator_item_position(0); | 246 | var indicatorItemCoordFirst = get_indicator_item_position(0); |
517 | 245 | var indicatorItemCoordNext = get_indicator_item_position(indicatorRow.count - 1); | 247 | var indicatorItemCoordNext = get_indicator_item_position(indicatorRow.count - 1); |
FAILED: Continuous integration, rev:619 jenkins. qa.ubuntu. com/job/ unity8- ci/2010/ jenkins. qa.ubuntu. com/job/ generic- mediumtests- trusty/ 2115/console jenkins. qa.ubuntu. com/job/ generic- mediumtests- trusty- touch/2014 jenkins. qa.ubuntu. com/job/ unity-phablet- qmluitests- trusty/ 841 jenkins. qa.ubuntu. com/job/ unity8- trusty- amd64-ci/ 532 jenkins. qa.ubuntu. com/job/ unity8- trusty- armhf-ci/ 534 jenkins. qa.ubuntu. com/job/ unity8- trusty- armhf-ci/ 534/artifact/ work/output/ *zip*/output. zip jenkins. qa.ubuntu. com/job/ unity8- trusty- i386-ci/ 532 jenkins. qa.ubuntu. com/job/ generic- mediumtests- builder- trusty- amd64/2115/ console jenkins. qa.ubuntu. com/job/ generic- mediumtests- builder- trusty- armhf/2014 jenkins. qa.ubuntu. com/job/ generic- mediumtests- builder- trusty- armhf/2014/ artifact/ work/output/ *zip*/output. zip jenkins. qa.ubuntu. com/job/ generic- mediumtests- runner- mako/4485 s-jenkins. ubuntu- ci:8080/ job/touch- flash-device/ 2851
http://
Executed test runs:
FAILURE: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild: s-jenkins. ubuntu- ci:8080/ job/unity8- ci/2010/ rebuild
http://