Merge lp:~nick-dedekind/unity8/lp1236267 into lp:unity8
- lp1236267
- Merge into trunk
Status: | Merged |
---|---|
Approved by: | Albert Astals Cid |
Approved revision: | 469 |
Merged at revision: | 514 |
Proposed branch: | lp:~nick-dedekind/unity8/lp1236267 |
Merge into: | lp:unity8 |
Prerequisite: | lp:~nick-dedekind/unity8/indicator.submenu-reinit |
Diff against target: |
345 lines (+217/-21) 8 files modified
Panel/Indicators/DefaultIndicatorWidget.qml (+32/-10) plugins/Unity/Indicators/qml/IndicatorWidget.qml (+1/-1) tests/mocks/Unity/Indicators/IndicatorBase.qml (+37/-0) tests/mocks/Unity/Indicators/IndicatorWidget.qml (+28/-0) tests/mocks/Unity/Indicators/RootActionState.qml (+18/-10) tests/mocks/Unity/Indicators/qmldir (+2/-0) tests/qmltests/CMakeLists.txt (+2/-0) tests/qmltests/Panel/Indicators/tst_DefaultIndicatorWidget.qml (+97/-0) |
To merge this branch: | bzr merge lp:~nick-dedekind/unity8/lp1236267 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
PS Jenkins bot (community) | continuous-integration | Approve | |
Albert Astals Cid (community) | Approve | ||
Review via email: mp+192924@code.launchpad.net |
This proposal supersedes a proposal from 2013-10-16.
Commit message
Round indicator widget icon/label width up to closest gu for alignment.
Description of the change
Round indicator widget icon/label width up to closest gu for alignment.
Preserve icon aspect ratio.
Added test for DefaultIndicato
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal | # |
Albert Astals Cid (aacid) wrote : Posted in a previous version of this proposal | # |
Do you think it makes sense for guRoundUp to be somewhere more central so it can be eventually reused? Or maybe do it when we need to?
MichaĆ Sawicz (saviq) wrote : Posted in a previous version of this proposal | # |
On 17.10.2013 11:24, Albert Astals Cid wrote:
> Do you think it makes sense for guRoundUp to be somewhere more central so it can be eventually reused? Or maybe do it when we need to?
Maybe we should even put it in the UITK for others to use? I.e. put it
on units.guRoundUp()?
Nick Dedekind (nick-dedekind) wrote : Posted in a previous version of this proposal | # |
> On 17.10.2013 11:24, Albert Astals Cid wrote:
> > Do you think it makes sense for guRoundUp to be somewhere more central so it
> can be eventually reused? Or maybe do it when we need to?
>
> Maybe we should even put it in the UITK for others to use? I.e. put it
> on units.guRoundUp()?
I'll put add a request to the toolkit, and up a TODO in here. Don't think it should be held up until we get that in though.
Nick Dedekind (nick-dedekind) wrote : Posted in a previous version of this proposal | # |
Added TODO for https:/
Albert Astals Cid (aacid) wrote : Posted in a previous version of this proposal | # |
Ok
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:467
http://
Executed test runs:
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
FAILURE: http://
FAILURE: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Michael Zanetti (mzanetti) wrote : Posted in a previous version of this proposal | # |
can we add a test for this?
Nick Dedekind (nick-dedekind) wrote : Posted in a previous version of this proposal | # |
> can we add a test for this?
Yes.
I've put it back into 'Needs review' until tests added.
Nick Dedekind (nick-dedekind) wrote : | # |
Added DefaultIndicato
Requires lp:~nick-dedekind/unity8/indicator.submenu-reinit
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:469
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
FAILURE: http://
FAILURE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
FAILURE: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
MichaĆ Sawicz (saviq) wrote : | # |
There's a failed autolanding coming - it's caused by the prerequisite branch.
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://
SUCCESS: http://
SUCCESS: http://
Albert Astals Cid (aacid) wrote : | # |
Pre-requisite got merged, try to land again.
PS Jenkins bot (ps-jenkins) : | # |
Preview Diff
1 | === modified file 'Panel/Indicators/DefaultIndicatorWidget.qml' | |||
2 | --- Panel/Indicators/DefaultIndicatorWidget.qml 2013-10-02 16:07:39 +0000 | |||
3 | +++ Panel/Indicators/DefaultIndicatorWidget.qml 2013-10-28 18:24:51 +0000 | |||
4 | @@ -24,7 +24,7 @@ | |||
5 | 24 | Indicators.IndicatorWidget { | 24 | Indicators.IndicatorWidget { |
6 | 25 | id: indicatorWidget | 25 | id: indicatorWidget |
7 | 26 | 26 | ||
9 | 27 | width: itemRow.width + units.gu(0.5) | 27 | width: itemRow.width |
10 | 28 | 28 | ||
11 | 29 | property alias leftLabel: itemLeftLabel.text | 29 | property alias leftLabel: itemLeftLabel.text |
12 | 30 | property alias rightLabel: itemRightLabel.text | 30 | property alias rightLabel: itemRightLabel.text |
13 | @@ -32,16 +32,17 @@ | |||
14 | 32 | 32 | ||
15 | 33 | Row { | 33 | Row { |
16 | 34 | id: itemRow | 34 | id: itemRow |
17 | 35 | width: childrenRect.width | ||
18 | 35 | objectName: "itemRow" | 36 | objectName: "itemRow" |
19 | 36 | anchors { | 37 | anchors { |
20 | 37 | top: parent.top | 38 | top: parent.top |
21 | 38 | bottom: parent.bottom | 39 | bottom: parent.bottom |
22 | 39 | horizontalCenter: parent.horizontalCenter | 40 | horizontalCenter: parent.horizontalCenter |
23 | 40 | } | 41 | } |
24 | 41 | spacing: units.gu(0.5) | ||
25 | 42 | 42 | ||
26 | 43 | Label { | 43 | Label { |
27 | 44 | id: itemLeftLabel | 44 | id: itemLeftLabel |
28 | 45 | width: guRoundUp(implicitWidth) | ||
29 | 45 | objectName: "leftLabel" | 46 | objectName: "leftLabel" |
30 | 46 | color: Theme.palette.selected.backgroundText | 47 | color: Theme.palette.selected.backgroundText |
31 | 47 | opacity: 0.8 | 48 | opacity: 0.8 |
32 | @@ -57,25 +58,35 @@ | |||
33 | 57 | top: parent.top | 58 | top: parent.top |
34 | 58 | bottom: parent.bottom | 59 | bottom: parent.bottom |
35 | 59 | } | 60 | } |
36 | 60 | spacing: units.gu(0.5) | ||
37 | 61 | 61 | ||
38 | 62 | Repeater { | 62 | Repeater { |
39 | 63 | model: indicatorWidget.icons | 63 | model: indicatorWidget.icons |
40 | 64 | 64 | ||
46 | 65 | Image { | 65 | Item { |
47 | 66 | id: itemImage | 66 | width: guRoundUp(itemImage.width) |
43 | 67 | objectName: "itemImage" | ||
44 | 68 | visible: source != "" | ||
45 | 69 | source: modelData | ||
48 | 70 | height: indicatorWidget.iconSize | 67 | height: indicatorWidget.iconSize |
51 | 71 | width: indicatorWidget.iconSize | 68 | |
52 | 72 | anchors.verticalCenter: parent.verticalCenter | 69 | Image { |
53 | 70 | id: itemImage | ||
54 | 71 | objectName: "itemImage" | ||
55 | 72 | visible: source != "" | ||
56 | 73 | source: modelData | ||
57 | 74 | height: parent.height | ||
58 | 75 | anchors.horizontalCenter: parent.horizontalCenter | ||
59 | 76 | fillMode: Image.PreserveAspectFit | ||
60 | 77 | |||
61 | 78 | sourceSize { | ||
62 | 79 | width: indicatorWidget.iconSize | ||
63 | 80 | height: indicatorWidget.iconSize | ||
64 | 81 | } | ||
65 | 82 | } | ||
66 | 73 | } | 83 | } |
67 | 74 | } | 84 | } |
68 | 75 | } | 85 | } |
69 | 76 | 86 | ||
70 | 77 | Label { | 87 | Label { |
71 | 78 | id: itemRightLabel | 88 | id: itemRightLabel |
72 | 89 | width: guRoundUp(implicitWidth) | ||
73 | 79 | objectName: "rightLabel" | 90 | objectName: "rightLabel" |
74 | 80 | color: Theme.palette.selected.backgroundText | 91 | color: Theme.palette.selected.backgroundText |
75 | 81 | opacity: 0.8 | 92 | opacity: 0.8 |
76 | @@ -86,6 +97,17 @@ | |||
77 | 86 | } | 97 | } |
78 | 87 | } | 98 | } |
79 | 88 | 99 | ||
80 | 100 | // TODO: Use toolkit function https://bugs.launchpad.net/ubuntu-ui-toolkit/+bug/1242575 | ||
81 | 101 | function guRoundUp(width) { | ||
82 | 102 | if (width == 0) { | ||
83 | 103 | return 0; | ||
84 | 104 | } | ||
85 | 105 | var gu1 = units.gu(1.0); | ||
86 | 106 | var mod = (width % gu1); | ||
87 | 107 | |||
88 | 108 | return mod == 0 ? width : width + (gu1 - mod); | ||
89 | 109 | } | ||
90 | 110 | |||
91 | 89 | onRootActionStateChanged: { | 111 | onRootActionStateChanged: { |
92 | 90 | if (rootActionState == undefined) { | 112 | if (rootActionState == undefined) { |
93 | 91 | leftLabel = ""; | 113 | leftLabel = ""; |
94 | 92 | 114 | ||
95 | === modified file 'plugins/Unity/Indicators/qml/IndicatorWidget.qml' | |||
96 | --- plugins/Unity/Indicators/qml/IndicatorWidget.qml 2013-09-30 16:37:55 +0000 | |||
97 | +++ plugins/Unity/Indicators/qml/IndicatorWidget.qml 2013-10-28 18:24:51 +0000 | |||
98 | @@ -24,5 +24,5 @@ | |||
99 | 24 | id: indicatorWidget | 24 | id: indicatorWidget |
100 | 25 | 25 | ||
101 | 26 | enabled: false | 26 | enabled: false |
103 | 27 | property int iconSize: height - units.gu(0.5) | 27 | property int iconSize: height |
104 | 28 | } | 28 | } |
105 | 29 | 29 | ||
106 | === added file 'tests/mocks/Unity/Indicators/IndicatorBase.qml' | |||
107 | --- tests/mocks/Unity/Indicators/IndicatorBase.qml 1970-01-01 00:00:00 +0000 | |||
108 | +++ tests/mocks/Unity/Indicators/IndicatorBase.qml 2013-10-28 18:24:51 +0000 | |||
109 | @@ -0,0 +1,37 @@ | |||
110 | 1 | /* | ||
111 | 2 | * Copyright 2013 Canonical Ltd. | ||
112 | 3 | * | ||
113 | 4 | * This program is free software; you can redistribute it and/or modify | ||
114 | 5 | * it under the terms of the GNU Lesser General Public License as published by | ||
115 | 6 | * the Free Software Foundation; version 3. | ||
116 | 7 | * | ||
117 | 8 | * This program is distributed in the hope that it will be useful, | ||
118 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
119 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
120 | 11 | * GNU Lesser General Public License for more details. | ||
121 | 12 | * | ||
122 | 13 | * You should have received a copy of the GNU Lesser General Public License | ||
123 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
124 | 15 | * | ||
125 | 16 | * Authors: | ||
126 | 17 | * Nick Dedekind <nick.dedekind@canonical.com> | ||
127 | 18 | */ | ||
128 | 19 | |||
129 | 20 | import QtQuick 2.0 | ||
130 | 21 | import QMenuModel 0.1 | ||
131 | 22 | |||
132 | 23 | Item { | ||
133 | 24 | id: indicatorBase | ||
134 | 25 | |||
135 | 26 | //const | ||
136 | 27 | property string busName | ||
137 | 28 | property string actionsObjectPath | ||
138 | 29 | property string rootMenuType: "com.canonical.indicator.root" | ||
139 | 30 | property string deviceMenuObjectPath | ||
140 | 31 | |||
141 | 32 | property var menuModel: UnityMenuModel {} | ||
142 | 33 | |||
143 | 34 | property RootActionState rootActionState: RootActionState { | ||
144 | 35 | onUpdated: indicatorBase.rootActionStateChanged() | ||
145 | 36 | } | ||
146 | 37 | } | ||
147 | 0 | 38 | ||
148 | === added file 'tests/mocks/Unity/Indicators/IndicatorWidget.qml' | |||
149 | --- tests/mocks/Unity/Indicators/IndicatorWidget.qml 1970-01-01 00:00:00 +0000 | |||
150 | +++ tests/mocks/Unity/Indicators/IndicatorWidget.qml 2013-10-28 18:24:51 +0000 | |||
151 | @@ -0,0 +1,28 @@ | |||
152 | 1 | /* | ||
153 | 2 | * Copyright 2013 Canonical Ltd. | ||
154 | 3 | * | ||
155 | 4 | * This program is free software; you can redistribute it and/or modify | ||
156 | 5 | * it under the terms of the GNU Lesser General Public License as published by | ||
157 | 6 | * the Free Software Foundation; version 3. | ||
158 | 7 | * | ||
159 | 8 | * This program is distributed in the hope that it will be useful, | ||
160 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
161 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
162 | 11 | * GNU Lesser General Public License for more details. | ||
163 | 12 | * | ||
164 | 13 | * You should have received a copy of the GNU Lesser General Public License | ||
165 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
166 | 15 | * | ||
167 | 16 | * Authors: | ||
168 | 17 | * Nick Dedekind <nick.dedekind@canonical.com> | ||
169 | 18 | */ | ||
170 | 19 | |||
171 | 20 | import QtQuick 2.0 | ||
172 | 21 | import Unity.Indicators 0.1 as Indicators | ||
173 | 22 | |||
174 | 23 | IndicatorBase { | ||
175 | 24 | id: indicatorWidget | ||
176 | 25 | |||
177 | 26 | enabled: false | ||
178 | 27 | property int iconSize: height | ||
179 | 28 | } | ||
180 | 0 | 29 | ||
181 | === modified file 'tests/mocks/Unity/Indicators/RootActionState.qml' | |||
182 | --- tests/mocks/Unity/Indicators/RootActionState.qml 2013-10-11 18:58:51 +0000 | |||
183 | +++ tests/mocks/Unity/Indicators/RootActionState.qml 2013-10-28 18:24:51 +0000 | |||
184 | @@ -20,14 +20,22 @@ | |||
185 | 20 | import QtQuick 2.0 | 20 | import QtQuick 2.0 |
186 | 21 | 21 | ||
187 | 22 | QtObject { | 22 | QtObject { |
198 | 23 | property var menu | 23 | property var menu |
199 | 24 | property bool valid: false | 24 | property bool valid: false |
200 | 25 | property string title | 25 | property string title |
201 | 26 | property string leftLabel | 26 | property string leftLabel |
202 | 27 | property string rightLabel | 27 | property string rightLabel |
203 | 28 | property var icons | 28 | property var icons |
204 | 29 | property string accessibleName | 29 | property string accessibleName |
205 | 30 | property bool visible: true | 30 | property bool visible: true |
206 | 31 | 31 | ||
207 | 32 | signal updated | 32 | signal updated |
208 | 33 | |||
209 | 34 | onValidChanged: updated() | ||
210 | 35 | onTitleChanged: updated() | ||
211 | 36 | onLeftLabelChanged: updated() | ||
212 | 37 | onRightLabelChanged: updated() | ||
213 | 38 | onIconsChanged: updated() | ||
214 | 39 | onAccessibleNameChanged: updated() | ||
215 | 40 | onVisibleChanged: updated() | ||
216 | 33 | } | 41 | } |
217 | 34 | 42 | ||
218 | === modified file 'tests/mocks/Unity/Indicators/qmldir' | |||
219 | --- tests/mocks/Unity/Indicators/qmldir 2013-10-11 18:58:51 +0000 | |||
220 | +++ tests/mocks/Unity/Indicators/qmldir 2013-10-28 18:24:51 +0000 | |||
221 | @@ -2,6 +2,8 @@ | |||
222 | 2 | plugin IndicatorsFakeQml | 2 | plugin IndicatorsFakeQml |
223 | 3 | 3 | ||
224 | 4 | CachedUnityMenuModel 0.1 CachedUnityMenuModel.qml | 4 | CachedUnityMenuModel 0.1 CachedUnityMenuModel.qml |
225 | 5 | IndicatorBase 0.1 IndicatorBase.qml | ||
226 | 6 | IndicatorWidget 0.1 IndicatorWidget.qml | ||
227 | 5 | IndicatorsModel 0.1 IndicatorsModel.qml | 7 | IndicatorsModel 0.1 IndicatorsModel.qml |
228 | 6 | FakeMenuPage 0.1 FakeMenuPage.qml | 8 | FakeMenuPage 0.1 FakeMenuPage.qml |
229 | 7 | RootActionState 0.1 RootActionState.qml | 9 | RootActionState 0.1 RootActionState.qml |
230 | 8 | 10 | ||
231 | === modified file 'tests/qmltests/CMakeLists.txt' | |||
232 | --- tests/qmltests/CMakeLists.txt 2013-10-28 18:24:51 +0000 | |||
233 | +++ tests/qmltests/CMakeLists.txt 2013-10-28 18:24:51 +0000 | |||
234 | @@ -71,6 +71,8 @@ | |||
235 | 71 | add_qml_test(Panel MenuContent IMPORT_PATHS ${CMAKE_BINARY_DIR}/plugins ${qmltest_DEFAULT_IMPORT_PATHS}) | 71 | add_qml_test(Panel MenuContent IMPORT_PATHS ${CMAKE_BINARY_DIR}/plugins ${qmltest_DEFAULT_IMPORT_PATHS}) |
236 | 72 | add_qml_test(Panel Panel IMPORT_PATHS ${CMAKE_BINARY_DIR}/plugins ${qmltest_DEFAULT_IMPORT_PATHS}) | 72 | add_qml_test(Panel Panel IMPORT_PATHS ${CMAKE_BINARY_DIR}/plugins ${qmltest_DEFAULT_IMPORT_PATHS}) |
237 | 73 | add_qml_test(Panel SearchIndicator) | 73 | add_qml_test(Panel SearchIndicator) |
238 | 74 | add_qml_test(Panel/Indicators DefaultIndicatorWidget IMPORT_PATHS ${CMAKE_BINARY_DIR}/plugins ${qmltest_DEFAULT_IMPORT_PATHS} | ||
239 | 75 | ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/tests/mocks/QMenuModel") | ||
240 | 74 | add_qml_test(SideStage SideStage IMPORT_PATHS ${qmltest_DEFAULT_IMPORT_PATHS} | 76 | add_qml_test(SideStage SideStage IMPORT_PATHS ${qmltest_DEFAULT_IMPORT_PATHS} |
241 | 75 | ${CMAKE_BINARY_DIR}/tests/mocks | 77 | ${CMAKE_BINARY_DIR}/tests/mocks |
242 | 76 | ${CMAKE_BINARY_DIR}/plugins) | 78 | ${CMAKE_BINARY_DIR}/plugins) |
243 | 77 | 79 | ||
244 | === added directory 'tests/qmltests/Panel/Indicators' | |||
245 | === added file 'tests/qmltests/Panel/Indicators/tst_DefaultIndicatorWidget.qml' | |||
246 | --- tests/qmltests/Panel/Indicators/tst_DefaultIndicatorWidget.qml 1970-01-01 00:00:00 +0000 | |||
247 | +++ tests/qmltests/Panel/Indicators/tst_DefaultIndicatorWidget.qml 2013-10-28 18:24:51 +0000 | |||
248 | @@ -0,0 +1,97 @@ | |||
249 | 1 | /* | ||
250 | 2 | * Copyright 2013 Canonical Ltd. | ||
251 | 3 | * | ||
252 | 4 | * This program is free software; you can redistribute it and/or modify | ||
253 | 5 | * it under the terms of the GNU General Public License as published by | ||
254 | 6 | * the Free Software Foundation; version 3. | ||
255 | 7 | * | ||
256 | 8 | * This program is distributed in the hope that it will be useful, | ||
257 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
258 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
259 | 11 | * GNU General Public License for more details. | ||
260 | 12 | * | ||
261 | 13 | * You should have received a copy of the GNU General Public License | ||
262 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
263 | 15 | */ | ||
264 | 16 | |||
265 | 17 | import QtQuick 2.0 | ||
266 | 18 | import QtTest 1.0 | ||
267 | 19 | import Unity.Test 0.1 as UT | ||
268 | 20 | import QMenuModel 0.1 | ||
269 | 21 | import "../../../../Panel/Indicators" | ||
270 | 22 | |||
271 | 23 | Item { | ||
272 | 24 | id: testView | ||
273 | 25 | width: units.gu(40) | ||
274 | 26 | height: units.gu(70) | ||
275 | 27 | |||
276 | 28 | DefaultIndicatorWidget { | ||
277 | 29 | id: widget | ||
278 | 30 | |||
279 | 31 | anchors { | ||
280 | 32 | left: parent.left | ||
281 | 33 | top: parent.top | ||
282 | 34 | } | ||
283 | 35 | |||
284 | 36 | busName: "test" | ||
285 | 37 | actionsObjectPath: "test" | ||
286 | 38 | deviceMenuObjectPath: "test" | ||
287 | 39 | |||
288 | 40 | rootMenuType: "" | ||
289 | 41 | |||
290 | 42 | iconSize: units.gu(3.2) | ||
291 | 43 | height: units.gu(3) | ||
292 | 44 | |||
293 | 45 | rootActionState { | ||
294 | 46 | icons: [ "image://theme/audio-volume-high", "image://theme/audio-volume-low" ] | ||
295 | 47 | leftLabel: "left" | ||
296 | 48 | rightLabel: "right" | ||
297 | 49 | } | ||
298 | 50 | } | ||
299 | 51 | |||
300 | 52 | UT.UnityTestCase { | ||
301 | 53 | name: "DefaultIndicatorWidget" | ||
302 | 54 | when: windowShown | ||
303 | 55 | |||
304 | 56 | function init() { | ||
305 | 57 | widget.rootActionState.icons = []; | ||
306 | 58 | widget.rootActionState.leftLabel = ""; | ||
307 | 59 | widget.rootActionState.rightLabel = ""; | ||
308 | 60 | wait(50); | ||
309 | 61 | } | ||
310 | 62 | |||
311 | 63 | function test_guRoundedWidth_data() { | ||
312 | 64 | return [ | ||
313 | 65 | { tag: "empty", icons: [], leftLabel: "", rightLabel: "" }, | ||
314 | 66 | { tag: "1-icon-no-label", icons: [ "image://theme/audio-volume-high" ], leftLabel: "", rightLabel: "" }, | ||
315 | 67 | { tag: "2-icon-no-label", icons: [ "image://theme/audio-volume-high", "image://theme/audio-volume-low" ], leftLabel: "", rightLabel: "" }, | ||
316 | 68 | { tag: "no-icon-l-label", icons: [], leftLabel: "left", rightLabel: "" }, | ||
317 | 69 | { tag: "no-icon-lr-label", icons: [], leftLabel: "left", rightLabel: "right" }, | ||
318 | 70 | { tag: "1-icon-l-label", icons: [ "image://theme/audio-volume-high" ], leftLabel: "left", rightLabel: "" }, | ||
319 | 71 | { tag: "1-icon-lr-label", icons: [ "image://theme/audio-volume-high" ], leftLabel: "left", rightLabel: "right" }, | ||
320 | 72 | { tag: "2-icon-l-label", icons: [ "image://theme/audio-volume-high", "image://theme/audio-volume-low" ], leftLabel: "left", rightLabel: "" }, | ||
321 | 73 | { tag: "2-icon-lr-label", icons: [ "image://theme/audio-volume-high", "image://theme/audio-volume-low" ], leftLabel: "left", rightLabel: "right" } | ||
322 | 74 | ]; | ||
323 | 75 | } | ||
324 | 76 | |||
325 | 77 | function test_guRoundedWidth(data) { | ||
326 | 78 | widget.rootActionState.icons = data.icons | ||
327 | 79 | widget.rootActionState.leftLabel = data.leftLabel; | ||
328 | 80 | widget.rootActionState.rightLabel = data.rightLabel; | ||
329 | 81 | wait(50); | ||
330 | 82 | |||
331 | 83 | compare(widget.width, guRoundUp(widget.width)); | ||
332 | 84 | } | ||
333 | 85 | } | ||
334 | 86 | |||
335 | 87 | // TODO: Use toolkit function https://bugs.launchpad.net/ubuntu-ui-toolkit/+bug/1242575 | ||
336 | 88 | function guRoundUp(width) { | ||
337 | 89 | if (width == 0) { | ||
338 | 90 | return 0; | ||
339 | 91 | } | ||
340 | 92 | var gu1 = units.gu(1.0); | ||
341 | 93 | var mod = (width % gu1); | ||
342 | 94 | |||
343 | 95 | return mod == 0 ? width : width + (gu1 - mod); | ||
344 | 96 | } | ||
345 | 97 | } |
FAILED: Continuous integration, rev:466 jenkins. qa.ubuntu. com/job/ unity8- ci/1421/ jenkins. qa.ubuntu. com/job/ generic- mediumtests- saucy/5047 jenkins. qa.ubuntu. com/job/ generic- mediumtests- touch/2985/ console jenkins. qa.ubuntu. com/job/ unity-phablet- qmluitests- saucy/2289 jenkins. qa.ubuntu. com/job/ unity8- saucy-amd64- ci/444 jenkins. qa.ubuntu. com/job/ unity8- saucy-armhf- ci/1421 jenkins. qa.ubuntu. com/job/ unity8- saucy-armhf- ci/1421/ artifact/ work/output/ *zip*/output. zip jenkins. qa.ubuntu. com/job/ unity8- saucy-i386- ci/1420 jenkins. qa.ubuntu. com/job/ autopilot- testrunner- otto-saucy/ 1217 jenkins. qa.ubuntu. com/job/ generic- mediumtests- builder- saucy-amd64/ 922 jenkins. qa.ubuntu. com/job/ generic- mediumtests- builder- saucy-amd64/ 922/artifact/ work/output/ *zip*/output. zip jenkins. qa.ubuntu. com/job/ generic- mediumtests- builder- saucy-armhf/ 2987 jenkins. qa.ubuntu. com/job/ generic- mediumtests- builder- saucy-armhf/ 2987/artifact/ work/output/ *zip*/output. zip jenkins. qa.ubuntu. com/job/ generic- mediumtests- runner- maguro/ 2493/console jenkins. qa.ubuntu. com/job/ generic- mediumtests- runner- mako/2537/ console
http://
Executed test runs:
UNSTABLE: http://
FAILURE: http://
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild: 10.97.0. 26:8080/ job/unity8- ci/1421/ rebuild
http://