Merge lp:~tpeeters/ubuntu-ui-toolkit/no-red-header into lp:ubuntu-ui-toolkit
- no-red-header
- Merge into trunk
Proposed by
Tim Peeters
Status: | Rejected |
---|---|
Rejected by: | Tim Peeters |
Proposed branch: | lp:~tpeeters/ubuntu-ui-toolkit/no-red-header |
Merge into: | lp:ubuntu-ui-toolkit |
Diff against target: |
855 lines (+319/-81) 34 files modified
components.api (+6/-0) debian/changelog (+28/-0) export_qml_dir.sh (+2/-0) src/Ubuntu/Components/1.3/AdaptivePageLayout.qml (+3/-0) src/Ubuntu/Components/1.3/PageHeader.qml (+2/-1) src/Ubuntu/Components/1.3/TextArea.qml (+3/-4) src/Ubuntu/Components/Styles/1.3/PageHeadStyle.qml (+1/-0) src/Ubuntu/Components/Styles/1.3/SectionsStyle.qml (+50/-0) src/Ubuntu/Components/Styles/Styles.pro (+1/-3) src/Ubuntu/Components/Styles/qmldir (+1/-0) src/Ubuntu/Components/Themes/Ambiance/1.2/PageHeadButton.qml (+1/-1) src/Ubuntu/Components/Themes/Ambiance/1.3/PageHeadButton.qml (+1/-1) src/Ubuntu/Components/Themes/Ambiance/1.3/PageHeadStyle.qml (+10/-0) src/Ubuntu/Components/Themes/Ambiance/1.3/PageHeaderStyle.qml (+1/-1) src/Ubuntu/Components/Themes/Ambiance/1.3/SectionsStyle.qml (+16/-30) src/Ubuntu/Components/Themes/Ambiance/1.3/TextAreaStyle.qml (+6/-0) src/Ubuntu/Components/Themes/ThemesModule.pro (+0/-3) src/Ubuntu/Components/plugin/ucabstractbutton.cpp (+0/-3) src/Ubuntu/Components/plugin/ucperformancemonitor.cpp (+24/-6) tests/unit/add_qmlmakecheck.pri (+1/-1) tests/unit/add_qmlmakecheck_x11.pri (+1/-1) tests/unit/i18n/LocalizedApp/LocalizedApp.pro (+0/-1) tests/unit/i18n/RelativeTime/RelativeTime.pro (+0/-1) tests/unit/mainview/mainview.pro (+0/-2) tests/unit/page/page.pro (+0/-2) tests/unit/performance/TextArea13Grid.qml (+33/-0) tests/unit/performance/tst_performance.cpp (+1/-0) tests/unit/runtest.sh (+20/-15) tests/unit/visual/gallery.qml (+78/-0) tests/unit/visual/gallery.sh (+6/-0) tests/unit/visual/tst_pageheader.qml (+2/-1) tests/unit/visual/tst_picker13.qml (+1/-0) tests/unit/visual/tst_popups_dialog13.qml (+13/-0) tests/xvfb.sh (+7/-4) |
To merge this branch: | bzr merge lp:~tpeeters/ubuntu-ui-toolkit/no-red-header |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
PS Jenkins bot | continuous-integration | Pending | |
Ubuntu SDK team | Pending | ||
Review via email: mp+297767@code.launchpad.net |
Commit message
Disable the red outline around deprecated headers in AdaptivePageLayout
Description of the change
To post a comment you must log in.
Revision history for this message
Tim Peeters (tpeeters) wrote : | # |
Unmerged revisions
- 2011. By Tim Peeters
-
disable red outline on deprecated header in APL
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'components.api' |
2 | --- components.api 2016-05-20 17:33:56 +0000 |
3 | +++ components.api 2016-06-17 13:30:14 +0000 |
4 | @@ -1076,6 +1076,12 @@ |
5 | property list<Action> actions |
6 | property var model |
7 | property int selectedIndex |
8 | +Ubuntu.Components.Styles.SectionsStyle 1.3: Item |
9 | + property color pressedBackgroundColor |
10 | + property color sectionColor |
11 | + property color selectedSectionColor |
12 | + property int textSize |
13 | + property color underlineColor |
14 | Ubuntu.Components.ServiceProperties 1.1 UCServiceProperties: QtObject |
15 | property string adaptorInterface 1.1 |
16 | readonly property string error 1.1 |
17 | |
18 | === modified file 'debian/changelog' |
19 | --- debian/changelog 2016-06-07 18:25:12 +0000 |
20 | +++ debian/changelog 2016-06-17 13:30:14 +0000 |
21 | @@ -1,3 +1,31 @@ |
22 | +ubuntu-ui-toolkit (1.3.2009+16.10) UNRELEASED; urgency=medium |
23 | + |
24 | + [ Tim Peeters ] |
25 | + * Introduce Styles.SectionsStyle. Fixes LP: #1585548 |
26 | + * Update header contents only after its style was initialized. |
27 | + Fixes LP: #1588837 |
28 | + * Update export_qml_dir.qml to work inside a lxd container. |
29 | + * Draw a red outline around the subheader in AdaptivePageLayout to warn that |
30 | + the old header is deprecated. Fixes LP: #1583636 |
31 | + |
32 | + [ Christian Dywan ] |
33 | + * Select the current item before adding the test page. |
34 | + * Introduce gallery for browsing visual tests. |
35 | + * Put Scrollbar in ShaderEffectSource to blend with frame. Fixes LP: #1583543 |
36 | + * Correctly use build/src dir with unit tests. Fixes LP: #1589982 |
37 | + |
38 | + [ Florian Boucault ] |
39 | + * Do not initialize haptics at startup but only when used for the first time. |
40 | + * PageHeadButton: do not load the icon until the button is made visible. |
41 | + |
42 | + [ Albert Astals Cid ] |
43 | + * Prepend UC_ to performance env vars. |
44 | + * Using -1 as PERFORMANCE_MONITOR_WARNING_COUNT_THRESHOLD envvar disables the |
45 | + warning count threshold. |
46 | + * Add envvars to change the performance monitor variables. |
47 | + |
48 | + -- Zoltán Balogh <zoltan@bakter.hu> Wed, 15 Jun 2016 17:44:31 +0300 |
49 | + |
50 | ubuntu-ui-toolkit (1.3.1995+16.10.20160607.1) yakkety; urgency=medium |
51 | |
52 | [ Albert Astals Cid ] |
53 | |
54 | === modified file 'export_qml_dir.sh' |
55 | --- export_qml_dir.sh 2016-04-05 16:14:13 +0000 |
56 | +++ export_qml_dir.sh 2016-06-17 13:30:14 +0000 |
57 | @@ -28,6 +28,8 @@ |
58 | export LD_LIBRARY_PATH=$BUILD_DIR/lib:$UBUNTU_QML_DIRS$LD_LIBRARY_PATH |
59 | # Build machines may not have initctl and don't need it |
60 | test -f /sbin/initctl || return 0 |
61 | +# initctl may be available but not working (for example in a lxd container without upstart) |
62 | +/sbin/initctl list > /dev/null || return 0 |
63 | /sbin/initctl set-env --global QML_IMPORT_PATH=$BUILD_DIR/qml |
64 | /sbin/initctl set-env --global QML2_IMPORT_PATH=$BUILD_DIR/qml |
65 | /sbin/initctl set-env --global UBUNTU_UI_TOOLKIT_THEMES_PATH=$BUILD_DIR/qml |
66 | |
67 | === modified file 'src/Ubuntu/Components/1.3/AdaptivePageLayout.qml' |
68 | --- src/Ubuntu/Components/1.3/AdaptivePageLayout.qml 2016-05-25 12:48:10 +0000 |
69 | +++ src/Ubuntu/Components/1.3/AdaptivePageLayout.qml 2016-06-17 13:30:14 +0000 |
70 | @@ -827,6 +827,9 @@ |
71 | property color panelColor: layout.__propagated.header.panelColor |
72 | property color backgroundColor: layout.__propagated.header.backgroundColor |
73 | |
74 | + // Enable red outline in the PageHeadStyle. See bug #1583636. |
75 | + property bool showDeprecatedWarning: false |
76 | + |
77 | visible: !customHeader && holder.pageWrapper && holder.pageWrapper.active |
78 | |
79 | // The multiColumn, page and showBackButton properties are used in |
80 | |
81 | === modified file 'src/Ubuntu/Components/1.3/PageHeader.qml' |
82 | --- src/Ubuntu/Components/1.3/PageHeader.qml 2016-05-25 12:48:10 +0000 |
83 | +++ src/Ubuntu/Components/1.3/PageHeader.qml 2016-06-17 13:30:14 +0000 |
84 | @@ -1,5 +1,5 @@ |
85 | /* |
86 | - * Copyright 2015 Canonical Ltd. |
87 | + * Copyright 2016 Canonical Ltd. |
88 | * |
89 | * This program is free software; you can redistribute it and/or modify |
90 | * it under the terms of the GNU Lesser General Public License as published by |
91 | @@ -109,6 +109,7 @@ |
92 | property Item previousContentsParent: null |
93 | |
94 | function updateContents() { |
95 | + if (!__styleInstance) return; // the style needs to be loaded first |
96 | if (previousContents) { |
97 | previousContents.parent = previousContentsParent; |
98 | } |
99 | |
100 | === modified file 'src/Ubuntu/Components/1.3/TextArea.qml' |
101 | --- src/Ubuntu/Components/1.3/TextArea.qml 2016-05-25 12:48:10 +0000 |
102 | +++ src/Ubuntu/Components/1.3/TextArea.qml 2016-06-17 13:30:14 +0000 |
103 | @@ -875,6 +875,9 @@ |
104 | } |
105 | } |
106 | } |
107 | + |
108 | + /*! \internal */ |
109 | + property Item __rightScrollbar: rightScrollbar |
110 | Scrollbar { |
111 | id: rightScrollbar |
112 | flickableItem: flicker |
113 | @@ -884,10 +887,6 @@ |
114 | anchors.topMargin: -internal.frameSpacing |
115 | anchors.rightMargin: -internal.frameSpacing |
116 | anchors.bottomMargin: -internal.frameSpacing |
117 | - Ubuntu.StyleHints { |
118 | - // No background color |
119 | - troughColorSteppersStyle: Qt.rgba(0, 0, 0, 0) |
120 | - } |
121 | } |
122 | |
123 | styleName: "TextAreaStyle" |
124 | |
125 | === modified file 'src/Ubuntu/Components/Styles/1.3/PageHeadStyle.qml' |
126 | --- src/Ubuntu/Components/Styles/1.3/PageHeadStyle.qml 2015-09-22 14:39:47 +0000 |
127 | +++ src/Ubuntu/Components/Styles/1.3/PageHeadStyle.qml 2016-06-17 13:30:14 +0000 |
128 | @@ -17,6 +17,7 @@ |
129 | |
130 | /*! |
131 | \qmltype PageHeadStyle |
132 | + \deprecated |
133 | \inqmlmodule Ubuntu.Components.Styles 1.1 |
134 | \ingroup style-api |
135 | \brief Style API for page header. |
136 | |
137 | === added file 'src/Ubuntu/Components/Styles/1.3/SectionsStyle.qml' |
138 | --- src/Ubuntu/Components/Styles/1.3/SectionsStyle.qml 1970-01-01 00:00:00 +0000 |
139 | +++ src/Ubuntu/Components/Styles/1.3/SectionsStyle.qml 2016-06-17 13:30:14 +0000 |
140 | @@ -0,0 +1,50 @@ |
141 | +/* |
142 | + * Copyright 2016 Canonical Ltd. |
143 | + * |
144 | + * This program is free software; you can redistribute it and/or modify |
145 | + * it under the terms of the GNU Lesser General Public License as published by |
146 | + * the Free Software Foundation; version 3. |
147 | + * |
148 | + * This program is distributed in the hope that it will be useful, |
149 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
150 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
151 | + * GNU Lesser General Public License for more details. |
152 | + * |
153 | + * You should have received a copy of the GNU Lesser General Public License |
154 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
155 | + */ |
156 | +import QtQuick 2.4 |
157 | +/*! |
158 | + \qmltype SectionsStyle |
159 | + \inqmlmodule Ubuntu.Components.Styles 1.3 |
160 | + \ingroup style-api |
161 | + \brief Style API for Sections. |
162 | + |
163 | + The component defines the style API for the \l Sections component. |
164 | + */ |
165 | +Item { |
166 | + /*! |
167 | + The foreground color of unselected sections. |
168 | + */ |
169 | + property color sectionColor |
170 | + |
171 | + /*! |
172 | + The foreground color of underline of unselected sections. |
173 | + */ |
174 | + property color underlineColor |
175 | + |
176 | + /*! |
177 | + The foreground color of the selected section. |
178 | + */ |
179 | + property color selectedSectionColor |
180 | + |
181 | + /*! |
182 | + The background color for the pressed section button. |
183 | + */ |
184 | + property color pressedBackgroundColor |
185 | + |
186 | + /*! |
187 | + The size of text in the buttons. |
188 | + */ |
189 | + property int textSize |
190 | +} |
191 | |
192 | === modified file 'src/Ubuntu/Components/Styles/Styles.pro' |
193 | --- src/Ubuntu/Components/Styles/Styles.pro 2015-11-24 20:49:07 +0000 |
194 | +++ src/Ubuntu/Components/Styles/Styles.pro 2016-06-17 13:30:14 +0000 |
195 | @@ -1,7 +1,5 @@ |
196 | TARGETPATH = Ubuntu/Components/Styles |
197 | |
198 | -ARTWORK_FILES = $$system(find artwork -type f) |
199 | - |
200 | QML_FILES += 1.2/ComboButtonStyle.qml \ |
201 | 1.2/PageHeadStyle.qml \ |
202 | 1.2/PullToRefreshStyle.qml \ |
203 | @@ -9,7 +7,7 @@ |
204 | 1.3/ActionBarStyle.qml \ |
205 | 1.3/PageHeaderStyle.qml \ |
206 | 1.3/ToolbarStyle.qml \ |
207 | - $$ARTWORK_FILES |
208 | + 1.3/SectionsStyle.qml \ |
209 | |
210 | load(ubuntu_qml_module) |
211 | |
212 | |
213 | === modified file 'src/Ubuntu/Components/Styles/qmldir' |
214 | --- src/Ubuntu/Components/Styles/qmldir 2015-11-24 20:49:07 +0000 |
215 | +++ src/Ubuntu/Components/Styles/qmldir 2016-06-17 13:30:14 +0000 |
216 | @@ -9,3 +9,4 @@ |
217 | ActionBarStyle 1.3 1.3/ActionBarStyle.qml |
218 | PageHeaderStyle 1.3 1.3/PageHeaderStyle.qml |
219 | ToolbarStyle 1.3 1.3/ToolbarStyle.qml |
220 | +SectionsStyle 1.3 1.3/SectionsStyle.qml |
221 | |
222 | === modified file 'src/Ubuntu/Components/Themes/Ambiance/1.2/PageHeadButton.qml' |
223 | --- src/Ubuntu/Components/Themes/Ambiance/1.2/PageHeadButton.qml 2015-04-24 14:43:08 +0000 |
224 | +++ src/Ubuntu/Components/Themes/Ambiance/1.2/PageHeadButton.qml 2016-06-17 13:30:14 +0000 |
225 | @@ -43,7 +43,7 @@ |
226 | // when the button is invisible by setting width and height to 0 |
227 | width: visible ? button.iconWidth : 0 |
228 | height: visible ? button.iconHeight : 0 |
229 | - source: button.iconSource |
230 | + source: visible ? button.iconSource : "" |
231 | color: Qt.rgba(0, 0, 0, 0) |
232 | opacity: button.enabled ? 1.0 : 0.3 |
233 | } |
234 | |
235 | === modified file 'src/Ubuntu/Components/Themes/Ambiance/1.3/PageHeadButton.qml' |
236 | --- src/Ubuntu/Components/Themes/Ambiance/1.3/PageHeadButton.qml 2015-09-21 14:44:13 +0000 |
237 | +++ src/Ubuntu/Components/Themes/Ambiance/1.3/PageHeadButton.qml 2016-06-17 13:30:14 +0000 |
238 | @@ -44,7 +44,7 @@ |
239 | // when the button is invisible by setting width and height to 0 |
240 | width: visible ? button.iconWidth : 0 |
241 | height: visible ? button.iconHeight : 0 |
242 | - source: button.iconSource |
243 | + source: visible ? button.iconSource : "" |
244 | color: Qt.rgba(0, 0, 0, 0) |
245 | opacity: button.enabled ? 1.0 : 0.3 |
246 | } |
247 | |
248 | === modified file 'src/Ubuntu/Components/Themes/Ambiance/1.3/PageHeadStyle.qml' |
249 | --- src/Ubuntu/Components/Themes/Ambiance/1.3/PageHeadStyle.qml 2016-02-29 16:02:50 +0000 |
250 | +++ src/Ubuntu/Components/Themes/Ambiance/1.3/PageHeadStyle.qml 2016-06-17 13:30:14 +0000 |
251 | @@ -50,8 +50,18 @@ |
252 | */ |
253 | property color backgroundColor: styledItem.backgroundColor |
254 | Rectangle { |
255 | + id: background |
256 | anchors.fill: parent |
257 | color: headerStyle.backgroundColor |
258 | + |
259 | + // The border is shown to warn the developer that the AppHeader |
260 | + // is deprecated. See bug #1583636 |
261 | + property bool showBorder: styledItem.hasOwnProperty("showDeprecatedWarning") && |
262 | + styledItem.showDeprecatedWarning |
263 | + border { |
264 | + width: background.showBorder ? units.gu(0.5) : 0 |
265 | + color: background.showBorder ? UbuntuColors.red : "transparent" |
266 | + } |
267 | } |
268 | |
269 | // FIXME: When the three panel color properties below are removed, |
270 | |
271 | === modified file 'src/Ubuntu/Components/Themes/Ambiance/1.3/PageHeaderStyle.qml' |
272 | --- src/Ubuntu/Components/Themes/Ambiance/1.3/PageHeaderStyle.qml 2016-05-06 08:53:16 +0000 |
273 | +++ src/Ubuntu/Components/Themes/Ambiance/1.3/PageHeaderStyle.qml 2016-06-17 13:30:14 +0000 |
274 | @@ -1,5 +1,5 @@ |
275 | /* |
276 | - * Copyright 2015 Canonical Ltd. |
277 | + * Copyright 2016 Canonical Ltd. |
278 | * |
279 | * This program is free software; you can redistribute it and/or modify |
280 | * it under the terms of the GNU Lesser General Public License as published by |
281 | |
282 | === modified file 'src/Ubuntu/Components/Themes/Ambiance/1.3/SectionsStyle.qml' |
283 | --- src/Ubuntu/Components/Themes/Ambiance/1.3/SectionsStyle.qml 2016-05-17 13:00:51 +0000 |
284 | +++ src/Ubuntu/Components/Themes/Ambiance/1.3/SectionsStyle.qml 2016-06-17 13:30:14 +0000 |
285 | @@ -15,44 +15,30 @@ |
286 | */ |
287 | import QtQuick 2.4 |
288 | import QtQuick.Window 2.2 |
289 | +import QtGraphicalEffects 1.0 |
290 | import Ubuntu.Components 1.3 |
291 | -import QtGraphicalEffects 1.0 |
292 | import Ubuntu.Components.Private 1.3 |
293 | +import Ubuntu.Components.Styles 1.3 as Style |
294 | |
295 | -Item { |
296 | +Style.SectionsStyle { |
297 | id: sectionsStyle |
298 | |
299 | implicitWidth: sectionsListView.contentWidth + 2 * listViewContainer.listViewMargins |
300 | implicitHeight: Screen.height > units.gu(50) ? units.gu(4) : units.gu(3) |
301 | |
302 | - /*! |
303 | - The foreground color of unselected sections. |
304 | - */ |
305 | - property color sectionColor: enabled |
306 | - ? theme.palette.normal.backgroundTertiaryText |
307 | - : theme.palette.disabled.backgroundTertiaryText |
308 | - |
309 | - /*! |
310 | - The foreground color of underline rectangle of unselected sections. |
311 | - */ |
312 | - property color underlineColor: theme.palette.normal.base |
313 | - |
314 | - /*! |
315 | - The foreground color of the selected section. |
316 | - */ |
317 | - property color selectedSectionColor: enabled |
318 | - ? theme.palette.selected.positionText |
319 | - : theme.palette.selectedDisabled.positionText |
320 | - |
321 | - /*! |
322 | - The background color for the pressed section button. |
323 | - */ |
324 | - property color pressedBackgroundColor: theme.palette.highlighted.background |
325 | - |
326 | - /*! |
327 | - The size of text in the buttons. |
328 | - */ |
329 | - property int textSize: Label.Medium |
330 | + sectionColor: enabled |
331 | + ? theme.palette.normal.backgroundTertiaryText |
332 | + : theme.palette.disabled.backgroundTertiaryText |
333 | + |
334 | + underlineColor: theme.palette.normal.base |
335 | + |
336 | + selectedSectionColor: enabled |
337 | + ? theme.palette.selected.positionText |
338 | + : theme.palette.selectedDisabled.positionText |
339 | + |
340 | + pressedBackgroundColor: theme.palette.highlighted.background |
341 | + |
342 | + textSize: Label.Medium |
343 | |
344 | /*! |
345 | The spacing on the left and right sides of the label |
346 | |
347 | === modified file 'src/Ubuntu/Components/Themes/Ambiance/1.3/TextAreaStyle.qml' |
348 | --- src/Ubuntu/Components/Themes/Ambiance/1.3/TextAreaStyle.qml 2016-05-10 12:08:32 +0000 |
349 | +++ src/Ubuntu/Components/Themes/Ambiance/1.3/TextAreaStyle.qml 2016-06-17 13:30:14 +0000 |
350 | @@ -76,6 +76,12 @@ |
351 | radius: units.gu(1.7) |
352 | backgroundColor: visuals.backgroundColor |
353 | aspect: UbuntuShape.Flat |
354 | + source: ShaderEffectSource { |
355 | + sourceItem: styledItem.__rightScrollbar ? styledItem.__rightScrollbar : null |
356 | + hideSource: true |
357 | + } |
358 | + sourceFillMode: UbuntuShape.Pad |
359 | + sourceHorizontalAlignment: UbuntuShape.AlignRight |
360 | } |
361 | } |
362 | |
363 | |
364 | === modified file 'src/Ubuntu/Components/Themes/ThemesModule.pro' |
365 | --- src/Ubuntu/Components/Themes/ThemesModule.pro 2015-05-19 09:23:01 +0000 |
366 | +++ src/Ubuntu/Components/Themes/ThemesModule.pro 2016-06-17 13:30:14 +0000 |
367 | @@ -1,12 +1,9 @@ |
368 | TARGETPATH = Ubuntu/Components/Themes |
369 | |
370 | |
371 | -ARTWORK_FILES = $$system(find artwork -type f) |
372 | - |
373 | QML_FILES += 1.2/Palette.qml \ |
374 | 1.2/PaletteValues.qml \ |
375 | 1.3/Palette.qml \ |
376 | 1.3/PaletteValues.qml \ |
377 | - $$ARTWORK_FILES |
378 | |
379 | load(ubuntu_qml_module) |
380 | |
381 | === modified file 'src/Ubuntu/Components/plugin/ucabstractbutton.cpp' |
382 | --- src/Ubuntu/Components/plugin/ucabstractbutton.cpp 2016-05-30 09:48:54 +0000 |
383 | +++ src/Ubuntu/Components/plugin/ucabstractbutton.cpp 2016-06-17 13:30:14 +0000 |
384 | @@ -129,9 +129,6 @@ |
385 | { |
386 | UCActionItem::classBegin(); |
387 | |
388 | - // make sure we have the haptics set up! |
389 | - HapticsProxy::instance()->initialize(); |
390 | - |
391 | // set up mouse area |
392 | Q_D(UCAbstractButton); |
393 | QQml_setParent_noEvent(d->mouseArea, this); |
394 | |
395 | === modified file 'src/Ubuntu/Components/plugin/ucperformancemonitor.cpp' |
396 | --- src/Ubuntu/Components/plugin/ucperformancemonitor.cpp 2016-03-15 13:46:27 +0000 |
397 | +++ src/Ubuntu/Components/plugin/ucperformancemonitor.cpp 2016-06-17 13:30:14 +0000 |
398 | @@ -21,10 +21,23 @@ |
399 | |
400 | Q_LOGGING_CATEGORY(ucPerformance, "[PERFORMANCE]") |
401 | |
402 | -const int singleFrameThreshold = 32; |
403 | -const int multipleFrameThreshold = 17; |
404 | -const int framesCountThreshold = 10; |
405 | -const int warningCountThreshold = 30; |
406 | +static int singleFrameThreshold = 32; |
407 | +static int multipleFrameThreshold = 17; |
408 | +static int framesCountThreshold = 10; |
409 | +static int warningCountThreshold = 30; |
410 | + |
411 | +// TODO Qt 5.5. switch to qEnvironmentVariableIntValue |
412 | +static int getenvInt(const char* name, int defaultValue) |
413 | +{ |
414 | + if (qEnvironmentVariableIsSet(name)) { |
415 | + QByteArray stringValue = qgetenv(name); |
416 | + bool ok; |
417 | + int value = stringValue.toFloat(&ok); |
418 | + return ok ? value : defaultValue; |
419 | + } else { |
420 | + return defaultValue; |
421 | + } |
422 | +} |
423 | |
424 | UCPerformanceMonitor::UCPerformanceMonitor(QObject* parent) : |
425 | QObject(parent), |
426 | @@ -34,6 +47,11 @@ |
427 | { |
428 | QObject::connect((QGuiApplication*)QGuiApplication::instance(), &QGuiApplication::applicationStateChanged, |
429 | this, &UCPerformanceMonitor::onApplicationStateChanged); |
430 | + |
431 | + singleFrameThreshold = getenvInt("UC_PERFORMANCE_MONITOR_SINGLE_FRAME_THRESHOLD", singleFrameThreshold); |
432 | + multipleFrameThreshold = getenvInt("UC_PERFORMANCE_MONITOR_MULTIPLE_FRAME_THRESHOLD", multipleFrameThreshold); |
433 | + framesCountThreshold = getenvInt("UC_PERFORMANCE_MONITOR_FRAMES_COUNT_THRESHOLD", framesCountThreshold); |
434 | + warningCountThreshold = getenvInt("UC_PERFORMANCE_MONITOR_WARNING_COUNT_THRESHOLD", warningCountThreshold); |
435 | } |
436 | |
437 | UCPerformanceMonitor::~UCPerformanceMonitor() |
438 | @@ -53,7 +71,7 @@ |
439 | |
440 | void UCPerformanceMonitor::onApplicationStateChanged(Qt::ApplicationState state) |
441 | { |
442 | - if (m_warningCount >= warningCountThreshold) { |
443 | + if (m_warningCount >= warningCountThreshold && warningCountThreshold != -1) { |
444 | // do not monitor performance if the warning count threshold was reached |
445 | return; |
446 | } |
447 | @@ -124,7 +142,7 @@ |
448 | m_framesAboveThreshold = 0; |
449 | } |
450 | |
451 | - if (m_warningCount >= warningCountThreshold) { |
452 | + if (m_warningCount >= warningCountThreshold && warningCountThreshold != -1) { |
453 | qCWarning(ucPerformance, "Too many warnings were given. Performance monitoring stops."); |
454 | connectToWindow(NULL); |
455 | } |
456 | |
457 | === modified file 'tests/unit/add_qmlmakecheck.pri' |
458 | --- tests/unit/add_qmlmakecheck.pri 2016-02-08 09:33:08 +0000 |
459 | +++ tests/unit/add_qmlmakecheck.pri 2016-06-17 13:30:14 +0000 |
460 | @@ -7,7 +7,7 @@ |
461 | for(TEST, TESTS) { |
462 | _uitk_command = cd $$_PRO_FILE_PWD_; |
463 | _uitk_command += env UITK_TEST_KEEP_RUNNING=1 |
464 | - _uitk_command += '$${ROOT_SOURCE_DIR}/tests/unit/runtest.sh "$$shadowed($$_PRO_FILE_PWD_)/$${TARGET}" "$${TEST}" minimal'; |
465 | + _uitk_command += '$${ROOT_SOURCE_DIR}/tests/unit/runtest.sh "$$shadowed($$_PRO_FILE_PWD_)/$${TARGET}" "$${_PRO_FILE_PWD_}/$${TEST}" minimal'; |
466 | |
467 | check.commands += $${_uitk_command} |
468 | |
469 | |
470 | === modified file 'tests/unit/add_qmlmakecheck_x11.pri' |
471 | --- tests/unit/add_qmlmakecheck_x11.pri 2016-05-30 15:14:42 +0000 |
472 | +++ tests/unit/add_qmlmakecheck_x11.pri 2016-06-17 13:30:14 +0000 |
473 | @@ -10,7 +10,7 @@ |
474 | for(TEST, TESTS) { |
475 | _uitk_command = cd $$_PRO_FILE_PWD_; |
476 | _uitk_command += env UITK_TEST_KEEP_RUNNING=1 |
477 | - _uitk_command += '$${ROOT_SOURCE_DIR}/tests/unit/runtest.sh "$$shadowed($$_PRO_FILE_PWD_)/$${TARGET}" "$${TEST}"'; |
478 | + _uitk_command += '$${ROOT_SOURCE_DIR}/tests/unit/runtest.sh "$$shadowed($$_PRO_FILE_PWD_)/$${TARGET}" "$${_PRO_FILE_PWD_}/$${TEST}"'; |
479 | |
480 | check.commands += $${_uitk_command} |
481 | |
482 | |
483 | === modified file 'tests/unit/i18n/LocalizedApp/LocalizedApp.pro' |
484 | --- tests/unit/i18n/LocalizedApp/LocalizedApp.pro 2016-05-31 09:02:35 +0000 |
485 | +++ tests/unit/i18n/LocalizedApp/LocalizedApp.pro 2016-06-17 13:30:14 +0000 |
486 | @@ -5,7 +5,6 @@ |
487 | DOMAIN = localizedApp |
488 | mo.target = mo |
489 | mo.commands = set -e; |
490 | -mo.commands += echo Generating localization; |
491 | mo.commands += msgfmt $$PWD/po/en_US.po -o $$PWD/$${DOMAIN}/share/locale/en/LC_MESSAGES/$${DOMAIN}.mo; |
492 | QMAKE_EXTRA_TARGETS += mo |
493 | PRE_TARGETDEPS += mo |
494 | |
495 | === modified file 'tests/unit/i18n/RelativeTime/RelativeTime.pro' |
496 | --- tests/unit/i18n/RelativeTime/RelativeTime.pro 2016-05-31 09:02:35 +0000 |
497 | +++ tests/unit/i18n/RelativeTime/RelativeTime.pro 2016-06-17 13:30:14 +0000 |
498 | @@ -5,7 +5,6 @@ |
499 | DOMAIN = ubuntu-ui-toolkit |
500 | mo.target = mo |
501 | mo.commands = set -e; |
502 | -mo.commands += echo Generating localization; |
503 | mo.commands += msgfmt $${PWD}/po/en_US.po -o $${PWD}/$${DOMAIN}/share/locale/en/LC_MESSAGES/$${DOMAIN}.mo; |
504 | QMAKE_EXTRA_TARGETS += mo |
505 | PRE_TARGETDEPS += mo |
506 | |
507 | === modified file 'tests/unit/mainview/mainview.pro' |
508 | --- tests/unit/mainview/mainview.pro 2016-05-31 09:02:35 +0000 |
509 | +++ tests/unit/mainview/mainview.pro 2016-06-17 13:30:14 +0000 |
510 | @@ -2,5 +2,3 @@ |
511 | |
512 | QT += gui |
513 | SOURCES += tst_mainview.cpp |
514 | - |
515 | -OTHER_FILES += $$system(ls tst_*.qml) |
516 | |
517 | === modified file 'tests/unit/page/page.pro' |
518 | --- tests/unit/page/page.pro 2016-05-31 09:02:35 +0000 |
519 | +++ tests/unit/page/page.pro 2016-06-17 13:30:14 +0000 |
520 | @@ -2,5 +2,3 @@ |
521 | |
522 | QT += gui |
523 | SOURCES += tst_page.cpp |
524 | - |
525 | -OTHER_FILES += $$system(ls tst_*.qml) |
526 | |
527 | === added file 'tests/unit/performance/TextArea13Grid.qml' |
528 | --- tests/unit/performance/TextArea13Grid.qml 1970-01-01 00:00:00 +0000 |
529 | +++ tests/unit/performance/TextArea13Grid.qml 2016-06-17 13:30:14 +0000 |
530 | @@ -0,0 +1,33 @@ |
531 | +/* |
532 | + * Copyright 2016 Canonical Ltd. |
533 | + * |
534 | + * This program is free software; you can redistribute it and/or modify |
535 | + * it under the terms of the GNU Lesser General Public License as published by |
536 | + * the Free Software Foundation; version 3. |
537 | + * |
538 | + * This program is distributed in the hope that it will be useful, |
539 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
540 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
541 | + * GNU Lesser General Public License for more details. |
542 | + * |
543 | + * You should have received a copy of the GNU Lesser General Public License |
544 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
545 | + */ |
546 | + |
547 | +import QtQuick 2.0 |
548 | +import Ubuntu.Components 1.3 |
549 | + |
550 | +Grid { |
551 | + width: units.gu(80) |
552 | + height: units.gu(60) |
553 | + rows: 16 |
554 | + columns: 16 |
555 | + |
556 | + Repeater { |
557 | + model: 16 * 16 |
558 | + |
559 | + TextField { |
560 | + text: i18n.tr("Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.") |
561 | + } |
562 | + } |
563 | +} |
564 | |
565 | === modified file 'tests/unit/performance/tst_performance.cpp' |
566 | --- tests/unit/performance/tst_performance.cpp 2015-12-07 22:16:52 +0000 |
567 | +++ tests/unit/performance/tst_performance.cpp 2016-06-17 13:30:14 +0000 |
568 | @@ -102,6 +102,7 @@ |
569 | QTest::addColumn<QString>("document"); |
570 | QTest::addColumn<QUrl>("theme"); |
571 | |
572 | + QTest::newRow("TextArea 1.3") << "TextArea13Grid.qml" << QUrl(); |
573 | QTest::newRow("AbstractButton 1.2") << "AbstractButtonGrid.qml" << QUrl(); |
574 | QTest::newRow("AbstractButton 1.3") << "AbstractButton13Grid.qml" << QUrl(); |
575 | QTest::newRow("grid with Rectangle") << "RectangleGrid.qml" << QUrl(); |
576 | |
577 | === modified file 'tests/unit/runtest.sh' |
578 | --- tests/unit/runtest.sh 2016-06-01 09:48:44 +0000 |
579 | +++ tests/unit/runtest.sh 2016-06-17 13:30:14 +0000 |
580 | @@ -43,14 +43,14 @@ |
581 | echo " $0 TEST_EXECUTABLE [QML_FILE] [QT_QPA_PLATFORM]" |
582 | echo '' |
583 | echo 'Examples:' |
584 | - echo " $0 $(relpath ${BUILD_DIR}/tests/unit/components/components) tst_label13.qml minimal" |
585 | + echo " $0 $(relpath ${BUILD_DIR}/tests/unit/components/components) $(relpath ${SRC_DIR}/tests/unit/components/tst_label13.qml) minimal" |
586 | echo '' |
587 | echo " cd $(relpath ${BUILD_DIR}/tests/unit/mainview)" |
588 | echo " ../$(basename $0) mainview minimal" |
589 | echo " cd ../../.." |
590 | echo '' |
591 | echo " cd $(relpath ${BUILD_DIR}/tests/unit/visual)" |
592 | - echo " ../../xvfb.sh ../../unit/$(basename $0) visual tst_listitem13.qml" |
593 | + echo " ../../xvfb.sh ../../unit/$(basename $0) visual ../../unit/visual/tst_listitem13.qml" |
594 | echo " cd ../../.." |
595 | echo '' |
596 | echo " $(relpath ${BUILD_DIR}/tests/xvfb.sh) $0 $(relpath ${BUILD_DIR}/tests/unit/bottomedge/bottomedge)" |
597 | @@ -74,20 +74,26 @@ |
598 | EOF |
599 | } |
600 | |
601 | +function abspath { |
602 | + if [[ "$1" = /* ]]; then |
603 | + ABSPATH=$1 |
604 | + else |
605 | + ABSPATH=./$1 |
606 | + fi |
607 | + # Note: '|| echo' so we get a sane error message if it doesn't exist |
608 | + echo -n $(readlink -f $ABSPATH || echo $ABSPATH) |
609 | +} |
610 | + |
611 | function create_test_cmd { |
612 | - if [[ "$_TARGETPATH" = /* ]]; then |
613 | - EXE=$_TARGETPATH |
614 | - else |
615 | - EXE=./$_TARGETPATH |
616 | - fi |
617 | + EXE=$(abspath $_TARGETPATH) |
618 | _CMD="-n $_TESTFILE -m 500" |
619 | |
620 | DEB_HOST_ARCH=$(dpkg-architecture -qDEB_HOST_ARCH) |
621 | if [[ ${DEB_HOST_ARCH} =~ 'arm' ]]; then |
622 | - _CMD="dbus-test-runner --task $(readlink -f $EXE) $_CMD" |
623 | + _CMD="dbus-test-runner --task $EXE $_CMD" |
624 | else |
625 | _CMD="dbus-test-runner --task gdb -p --quiet $_CMD" |
626 | - _CMD="$_CMD -p --batch -p -ex -p 'set print thread-events off' -p -ex -p run -p -ex -p bt -p --return-child-result -p --args -p $(readlink -f $EXE)" |
627 | + _CMD="$_CMD -p --batch -p -ex -p 'set print thread-events off' -p -ex -p run -p -ex -p bt -p --return-child-result -p --args -p $EXE" |
628 | fi |
629 | |
630 | if [[ 'minimal custom' == *$_MINIMAL* ]]; then |
631 | @@ -95,27 +101,26 @@ |
632 | fi |
633 | |
634 | if [[ $_TESTFILEPATH == *\.qml* ]]; then |
635 | - _CMD="$_CMD -p -input -p $_TESTFILEPATH" |
636 | + _CMD="$_CMD -p -input -p $(abspath $_TESTFILEPATH)" |
637 | fi |
638 | _CMD="$_CMD -p -maxwarnings -p 100" |
639 | } |
640 | |
641 | function execute_test_cmd { |
642 | echo "Executing $_CMD $_ARGS" |
643 | - echo "Working directory: $PWD" |
644 | if [ ! -x $_TARGETPATH ]; then |
645 | echo "Error: $_TARGET wasn't built!" |
646 | RESULT=2 |
647 | elif [ $DISPLAY ]; then |
648 | - cd $(dirname $_TARGETPATH) |
649 | + SRC_TARGETPATH=$(echo $EXE | sed "s@$BUILD_DIR@$SRC_DIR@") |
650 | + cd $(dirname $SRC_TARGETPATH) |
651 | |
652 | # https://bugs.launchpad.net/ubuntu-ui-toolkit/+bug/1256999 |
653 | # https://bugreports.qt-project.org/browse/QTBUG-36243 |
654 | - |
655 | # QV4_MM_AGGRESSIVE_GC=1 \ |
656 | ALARM_BACKEND=memory SUPPRESS_DEPRECATED_NOTE=no \ |
657 | QT_LOGGING_RULES="[PERFORMANCE].warning=false" \ |
658 | - $_CMD $_ARGS 2>&1 | grep -v 'QFontDatabase: Cannot find font directory' |
659 | + $_CMD $_ARGS 2>&1 | sed "s@$_TESTFILE: @@" | grep -v 'QFontDatabase: Cannot find font directory' |
660 | if [ ! -s $_XML ]; then |
661 | # Write fallback in case it crashed and the file is empty |
662 | if [[ $_XML == *".SEGFAULT"* ]]; then |
663 | @@ -125,7 +130,7 @@ |
664 | fi |
665 | fi |
666 | if [ "x$UITK_TEST_KEEP_RUNNING" != "x1" ]; then |
667 | - ${BUILD_DIR}/tests/checkresults.sh $_XML |
668 | + ${SRC_DIR}/tests/checkresults.sh $_XML |
669 | RESULT=$? |
670 | fi |
671 | else |
672 | |
673 | === added file 'tests/unit/visual/gallery.qml' |
674 | --- tests/unit/visual/gallery.qml 1970-01-01 00:00:00 +0000 |
675 | +++ tests/unit/visual/gallery.qml 2016-06-17 13:30:14 +0000 |
676 | @@ -0,0 +1,78 @@ |
677 | +/* |
678 | + * Copyright 2016 Canonical Ltd. |
679 | + * |
680 | + * This program is free software; you can redistribute it and/or modify |
681 | + * it under the terms of the GNU Lesser General Public License as published by |
682 | + * the Free Software Foundation; version 3. |
683 | + * |
684 | + * This program is distributed in the hope that it will be useful, |
685 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
686 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
687 | + * GNU Lesser General Public License for more details. |
688 | + * |
689 | + * You should have received a copy of the GNU Lesser General Public License |
690 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
691 | + */ |
692 | + |
693 | +import QtQuick 2.4 |
694 | +import Ubuntu.Components 1.3 |
695 | +import Qt.labs.folderlistmodel 2.1 |
696 | + |
697 | +MainView { |
698 | + width: units.gu(120) |
699 | + height: units.gu(75) |
700 | + |
701 | + AdaptivePageLayout { |
702 | + id: pageLayout |
703 | + anchors.fill: parent |
704 | + primaryPage: Page { |
705 | + header: PageHeader { |
706 | + flickable: testsListView |
707 | + title: 'Unit Tests' |
708 | + } |
709 | + |
710 | + UbuntuListView { |
711 | + id: testsListView |
712 | + anchors.fill: parent |
713 | + model: FolderListModel { |
714 | + Component.onCompleted: folder += '/tests/unit/visual' |
715 | + showDirs: false |
716 | + showOnlyReadable: true |
717 | + sortField: FolderListModel.Name |
718 | + nameFilters: [ "tst_*13.qml" ] |
719 | + } |
720 | + |
721 | + delegate: ListItem { |
722 | + height: listItemLayout.height |
723 | + ListItemLayout { |
724 | + id: listItemLayout |
725 | + title.text: fileBaseName |
726 | + ProgressionSlot {} |
727 | + } |
728 | + onClicked: { |
729 | + testsListView.currentIndex = index |
730 | + pageLayout.addPageToNextColumn(pageLayout.primaryPage, testPage, { source: fileURL, title: fileBaseName }) |
731 | + } |
732 | + } |
733 | + } |
734 | + } |
735 | + asynchronous: false |
736 | + |
737 | + Page { |
738 | + id: testPage |
739 | + property alias source: testLoader.source |
740 | + header: PageHeader { |
741 | + id: testPageHeader |
742 | + title: testPage.title |
743 | + } |
744 | + |
745 | + Loader { |
746 | + id: testLoader |
747 | + anchors.fill: parent |
748 | + anchors.topMargin: testPage.header.height |
749 | + asynchronous: false |
750 | + } |
751 | + } |
752 | + } |
753 | +} |
754 | + |
755 | |
756 | === added file 'tests/unit/visual/gallery.sh' |
757 | --- tests/unit/visual/gallery.sh 1970-01-01 00:00:00 +0000 |
758 | +++ tests/unit/visual/gallery.sh 2016-06-17 13:30:14 +0000 |
759 | @@ -0,0 +1,6 @@ |
760 | +#!/bin/bash |
761 | + |
762 | +. `dirname ${BASH_SOURCE[0]}`/../../../export_qml_dir.sh || exit 1 |
763 | + |
764 | +SCRIPT_DIRECTORY=`dirname $0` |
765 | +$BUILD_DIR/ubuntu-ui-toolkit-launcher/ubuntu-ui-toolkit-launcher $@ $SCRIPT_DIRECTORY/gallery.qml |
766 | |
767 | === modified file 'tests/unit/visual/tst_pageheader.qml' |
768 | --- tests/unit/visual/tst_pageheader.qml 2016-03-30 15:12:36 +0000 |
769 | +++ tests/unit/visual/tst_pageheader.qml 2016-06-17 13:30:14 +0000 |
770 | @@ -238,7 +238,8 @@ |
771 | |
772 | Switch { |
773 | id: subtitleSwitch |
774 | - checked: false |
775 | + // Subtitle enabled initially as a regression test for bug #1588837. |
776 | + checked: true |
777 | } |
778 | Label { |
779 | text: "subtitle" |
780 | |
781 | === modified file 'tests/unit/visual/tst_picker13.qml' |
782 | --- tests/unit/visual/tst_picker13.qml 2016-03-15 13:26:55 +0000 |
783 | +++ tests/unit/visual/tst_picker13.qml 2016-06-17 13:30:14 +0000 |
784 | @@ -100,6 +100,7 @@ |
785 | Loader { |
786 | id: pickerLoader |
787 | asynchronous: false |
788 | + sourceComponent: defaultPicker |
789 | } |
790 | |
791 | ListModel { |
792 | |
793 | === modified file 'tests/unit/visual/tst_popups_dialog13.qml' |
794 | --- tests/unit/visual/tst_popups_dialog13.qml 2016-03-15 13:26:55 +0000 |
795 | +++ tests/unit/visual/tst_popups_dialog13.qml 2016-06-17 13:30:14 +0000 |
796 | @@ -26,6 +26,13 @@ |
797 | width: units.gu(40) |
798 | height: units.gu(71) |
799 | |
800 | + Button { |
801 | + id: pressMe |
802 | + anchors.top: parent.top |
803 | + text: "Open Dialog" |
804 | + onClicked: PopupUtils.open(dialog) |
805 | + } |
806 | + |
807 | UbuntuTestCase { |
808 | id: test |
809 | name: "Popups.Dialog" |
810 | @@ -45,7 +52,13 @@ |
811 | Component { |
812 | id: dialog |
813 | Dialog { |
814 | + id: ahojDialog |
815 | title: "Ahoj" |
816 | + |
817 | + Button { |
818 | + text: "Close" |
819 | + onClicked: PopupUtils.close(ahojDialog) |
820 | + } |
821 | } |
822 | } |
823 | } |
824 | |
825 | === modified file 'tests/xvfb.sh' |
826 | --- tests/xvfb.sh 2013-12-19 14:46:25 +0000 |
827 | +++ tests/xvfb.sh 2016-06-17 13:30:14 +0000 |
828 | @@ -1,4 +1,4 @@ |
829 | -#!/bin/sh |
830 | +#!/bin/bash |
831 | # |
832 | # Copyright 2013 Canonical Ltd. |
833 | # |
834 | @@ -16,15 +16,18 @@ |
835 | # |
836 | # Author: Christian Dywan <christian.dywan@canonical.com> |
837 | |
838 | +. `dirname ${BASH_SOURCE[0]}`/../export_qml_dir.sh || exit 1 |
839 | + |
840 | +LOG=$BUILD_DIR/xvfb.err |
841 | echo Running $@ in virtual frame buffer... |
842 | -xvfb-run -a -s "-screen 0 1280x1024x24" -e xvfb.err "$@" 2>test.err |
843 | +xvfb-run -a -s "-screen 0 1280x1024x24" -e $LOG "$@" 2>$LOG |
844 | RETVAL=$? |
845 | if [ $RETVAL -eq 0 ]; then |
846 | echo $@ finished successfully... |
847 | else |
848 | echo $@ in virtual frame buffer failed... |
849 | - cat test.err >&2 |
850 | + cat $LOG >&2 |
851 | echo Tail of xvfb-run output: |
852 | - tail xvfb.err >&2 |
853 | + tail $LOG >&2 |
854 | exit $RETVAL |
855 | fi |
outdated