Merge lp:~zsombi/ubuntu-ui-toolkit/icon_async into lp:ubuntu-ui-toolkit/staging
- icon_async
- Merge into staging
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Cris Dywan | ||||
Approved revision: | 1833 | ||||
Merged at revision: | 1845 | ||||
Proposed branch: | lp:~zsombi/ubuntu-ui-toolkit/icon_async | ||||
Merge into: | lp:ubuntu-ui-toolkit/staging | ||||
Diff against target: |
188 lines (+148/-0) 3 files modified
components.api (+2/-0) src/Ubuntu/Components/1.3/Icon.qml (+7/-0) tests/unit_x11/tst_components/tst_icon13.qml (+139/-0) |
||||
To merge this branch: | bzr merge lp:~zsombi/ubuntu-ui-toolkit/icon_async | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
ubuntu-sdk-build-bot | continuous-integration | Approve | |
Cris Dywan | Approve | ||
Albert Astals Cid (community) | Approve | ||
Review via email: mp+284599@code.launchpad.net |
Commit message
Expose Icon.asynchronous property to drive image loading of the icon.
Description of the change
Expose Icon.asynchronous property to drive image loading of the icon.
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
FAILED: Continuous integration, rev:1828
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
Albert Astals Cid (aacid) wrote : | # |
proeprty -> property
Defaults to true. -> Defaults to false.
- 1829. By Zsombor Egri
-
typo and default value mistake fixed
- 1830. By Zsombor Egri
-
staging sync
Albert Astals Cid (aacid) wrote : | # |
Looks good to me
Cris Dywan (kalikiana) wrote : | # |
This obviously make sense... it's unfortunate however very sensible to keep it off by default... maybe we can re-consider that for 1.4 at least.
I notice test_keyColor no longer has the work-around for qtbug 49713 where log is '' and the value is Error, I can't imagine how that bug would no longer apply here.
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
FAILED: Continuous integration, rev:1830
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
FAILED: Continuous integration, rev:1830
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
FAILED: Continuous integration, rev:1830
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
- 1831. By Zsombor Egri
-
moving shader result test from previous version
Cris Dywan (kalikiana) wrote : | # |
Thanks! Let's see the test passing now.
- 1832. By Zsombor Egri
-
API updated
- 1833. By Zsombor Egri
-
fixing API changes
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
FAILED: Continuous integration, rev:1830
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
FAILED: Continuous integration, rev:1830
https:/
Executed test runs:
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
None: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
PASSED: Continuous integration, rev:1833
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
PASSED: Continuous integration, rev:1833
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
PASSED: Continuous integration, rev:1833
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
PASSED: Continuous integration, rev:1833
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
PASSED: Continuous integration, rev:1833
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
SUCCESS: https:/
None: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
PASSED: Continuous integration, rev:1833
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
PASSED: Continuous integration, rev:1833
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
PASSED: Continuous integration, rev:1833
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
PASSED: Continuous integration, rev:1833
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
Preview Diff
1 | === modified file 'components.api' | |||
2 | --- components.api 2016-02-08 12:03:42 +0000 | |||
3 | +++ components.api 2016-02-11 09:50:36 +0000 | |||
4 | @@ -500,6 +500,7 @@ | |||
5 | 500 | Ubuntu.Components.Icon 1.1: Icon | 500 | Ubuntu.Components.Icon 1.1: Icon |
6 | 501 | property url source | 501 | property url source |
7 | 502 | Ubuntu.Components.Icon 1.3: Item | 502 | Ubuntu.Components.Icon 1.3: Item |
8 | 503 | property bool asynchronous | ||
9 | 503 | property color color | 504 | property color color |
10 | 504 | property color keyColor | 505 | property color keyColor |
11 | 505 | property string name | 506 | property string name |
12 | @@ -1006,6 +1007,7 @@ | |||
13 | 1006 | property bool showProgressPercentage | 1007 | property bool showProgressPercentage |
14 | 1007 | property double value | 1008 | property double value |
15 | 1008 | Ubuntu.Components.ProgressionSlot 1.3: Item | 1009 | Ubuntu.Components.ProgressionSlot 1.3: Item |
16 | 1010 | property bool asynchronous | ||
17 | 1009 | property color color | 1011 | property color color |
18 | 1010 | property color keyColor | 1012 | property color keyColor |
19 | 1011 | property string name | 1013 | property string name |
20 | 1012 | 1014 | ||
21 | === modified file 'src/Ubuntu/Components/1.3/Icon.qml' | |||
22 | --- src/Ubuntu/Components/1.3/Icon.qml 2015-12-14 08:55:29 +0000 | |||
23 | +++ src/Ubuntu/Components/1.3/Icon.qml 2016-02-11 09:50:36 +0000 | |||
24 | @@ -101,6 +101,12 @@ | |||
25 | 101 | 101 | ||
26 | 102 | property alias source: image.source | 102 | property alias source: image.source |
27 | 103 | 103 | ||
28 | 104 | /*! | ||
29 | 105 | \qmlproperty bool Icon::asynchronous | ||
30 | 106 | The property drives the image loading of the icon. Defaults to false. | ||
31 | 107 | */ | ||
32 | 108 | property alias asynchronous: image.asynchronous | ||
33 | 109 | |||
34 | 104 | implicitWidth: image.implicitWidth | 110 | implicitWidth: image.implicitWidth |
35 | 105 | implicitHeight: image.implicitHeight | 111 | implicitHeight: image.implicitHeight |
36 | 106 | 112 | ||
37 | @@ -119,6 +125,7 @@ | |||
38 | 119 | 125 | ||
39 | 120 | cache: true | 126 | cache: true |
40 | 121 | visible: !colorizedImage.visible | 127 | visible: !colorizedImage.visible |
41 | 128 | asynchronous: false | ||
42 | 122 | } | 129 | } |
43 | 123 | 130 | ||
44 | 124 | ShaderEffect { | 131 | ShaderEffect { |
45 | 125 | 132 | ||
46 | === added file 'tests/unit_x11/tst_components/tst_icon13.qml' | |||
47 | --- tests/unit_x11/tst_components/tst_icon13.qml 1970-01-01 00:00:00 +0000 | |||
48 | +++ tests/unit_x11/tst_components/tst_icon13.qml 2016-02-11 09:50:36 +0000 | |||
49 | @@ -0,0 +1,139 @@ | |||
50 | 1 | /* | ||
51 | 2 | * Copyright 2016 Canonical Ltd. | ||
52 | 3 | * | ||
53 | 4 | * This program is free software; you can redistribute it and/or modify | ||
54 | 5 | * it under the terms of the GNU Lesser General Public License as published by | ||
55 | 6 | * the Free Software Foundation; version 3. | ||
56 | 7 | * | ||
57 | 8 | * This program is distributed in the hope that it will be useful, | ||
58 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
59 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
60 | 11 | * GNU Lesser General Public License for more details. | ||
61 | 12 | * | ||
62 | 13 | * You should have received a copy of the GNU Lesser General Public License | ||
63 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
64 | 15 | */ | ||
65 | 16 | |||
66 | 17 | import QtQuick 2.4 | ||
67 | 18 | import QtTest 1.0 | ||
68 | 19 | import Ubuntu.Components 1.3 | ||
69 | 20 | import Ubuntu.Test 1.0 | ||
70 | 21 | |||
71 | 22 | Item { | ||
72 | 23 | width: units.gu(50) | ||
73 | 24 | height: units.gu(50) | ||
74 | 25 | |||
75 | 26 | Row { | ||
76 | 27 | anchors.centerIn: parent | ||
77 | 28 | height: units.gu(10) | ||
78 | 29 | width: childrenRect.width | ||
79 | 30 | |||
80 | 31 | Icon { | ||
81 | 32 | // Fails to load the icon when suru-icon-theme or libqt5svg5 are | ||
82 | 33 | // not installed. This causes a warning and rejection | ||
83 | 34 | // by jenkins continuous integration. | ||
84 | 35 | name: "add" | ||
85 | 36 | height: parent.height | ||
86 | 37 | width: height | ||
87 | 38 | } | ||
88 | 39 | Icon { | ||
89 | 40 | // Fails when the icon is becoming invisible when non-atomic updates | ||
90 | 41 | // cause sourceSize.width or sourceSize.height to be 0 before other | ||
91 | 42 | // properties are updated. | ||
92 | 43 | id: icon | ||
93 | 44 | width: visible ? units.gu(10) : 0 | ||
94 | 45 | height: width | ||
95 | 46 | name: "search" | ||
96 | 47 | } | ||
97 | 48 | Icon { | ||
98 | 49 | id: icon2 | ||
99 | 50 | width: units.gu(10) | ||
100 | 51 | height: width | ||
101 | 52 | } | ||
102 | 53 | Icon { | ||
103 | 54 | // Regression test for bug #1371509 | ||
104 | 55 | // Will print "QML QQuickImage: Failed to get image from provider" when broken. | ||
105 | 56 | id: icon3 | ||
106 | 57 | width: units.gu(10) | ||
107 | 58 | height: width | ||
108 | 59 | source: Qt.resolvedUrl("tst_icon-select.png") | ||
109 | 60 | } | ||
110 | 61 | } | ||
111 | 62 | |||
112 | 63 | UbuntuTestCase { | ||
113 | 64 | name: "Icon" | ||
114 | 65 | when: windowShown | ||
115 | 66 | |||
116 | 67 | SignalSpy { | ||
117 | 68 | id: shaderSpy | ||
118 | 69 | signalName: 'onStatusChanged' | ||
119 | 70 | } | ||
120 | 71 | |||
121 | 72 | function cleanup() { | ||
122 | 73 | icon2.name = ""; | ||
123 | 74 | } | ||
124 | 75 | |||
125 | 76 | function initTestCase() { | ||
126 | 77 | compare(icon.asynchronous, false, "asynchronous default value differs"); | ||
127 | 78 | } | ||
128 | 79 | |||
129 | 80 | function test_updateIconSize_bug1349769() { | ||
130 | 81 | icon.visible = false; | ||
131 | 82 | // causes "QML Image: Failed to get image from provider: image://theme/search" | ||
132 | 83 | // warning when sourceSize.width or sourceSize.height becomes 0 while | ||
133 | 84 | // while still trying to render the icon. Tests will pass with the warning, but | ||
134 | 85 | // the MR is rejected by jenkins continuous integration. | ||
135 | 86 | } | ||
136 | 87 | |||
137 | 88 | function test_name() { | ||
138 | 89 | icon2.name = "search"; | ||
139 | 90 | |||
140 | 91 | var image = findChild(icon2, "image"); | ||
141 | 92 | compare(image.source, "image://theme/search", | ||
142 | 93 | "Source of the image should be image://theme/{name}."); | ||
143 | 94 | } | ||
144 | 95 | |||
145 | 96 | function test_source() { | ||
146 | 97 | icon2.name = "search"; | ||
147 | 98 | icon2.source = "/usr/share/icons/suru/actions/scalable/edit-find.svg"; | ||
148 | 99 | |||
149 | 100 | var image = findChild(icon2, "image"); | ||
150 | 101 | compare(image.source, | ||
151 | 102 | "file:///usr/share/icons/suru/actions/scalable/edit-find.svg", | ||
152 | 103 | "Source of the image should equal icon2.source."); | ||
153 | 104 | } | ||
154 | 105 | |||
155 | 106 | function test_keyColor() { | ||
156 | 107 | icon.visible = true; | ||
157 | 108 | var image = findChild(icon, "image"); | ||
158 | 109 | var shader = findChild(icon, "shader"); | ||
159 | 110 | shaderSpy.target = shader; | ||
160 | 111 | |||
161 | 112 | compare(icon.name, 'search'); | ||
162 | 113 | compare(shader.visible, false); | ||
163 | 114 | compare(shader.status, ShaderEffect.Uncompiled) | ||
164 | 115 | icon.color = UbuntuColors.orange; | ||
165 | 116 | shaderSpy.wait(); | ||
166 | 117 | compare(shader.log, '') | ||
167 | 118 | // https://bugreports.qt.io/browse/QTBUG-49713 | ||
168 | 119 | // status may be Error with no log even if successful | ||
169 | 120 | verify(shader.status !== ShaderEffect.Uncompiled) | ||
170 | 121 | compare(shader.keyColorOut, icon.color); | ||
171 | 122 | compare(shader.visible, true); | ||
172 | 123 | compare(shader.source, image); | ||
173 | 124 | icon.keyColor = UbuntuColors.purple; | ||
174 | 125 | compare(shader.keyColorIn, icon.keyColor); | ||
175 | 126 | // Unsetting the icon name should disable the shader | ||
176 | 127 | icon.name = ''; | ||
177 | 128 | compare(icon.source, ''); | ||
178 | 129 | compare(shader.visible, false); | ||
179 | 130 | // Let's get back to a valid source | ||
180 | 131 | icon.name = 'search'; | ||
181 | 132 | compare(shader.visible, true); | ||
182 | 133 | compare(shader.source, image); | ||
183 | 134 | // Unsetting the keyColor should also disable the shader | ||
184 | 135 | icon.color = Qt.rgba(0.0, 0.0, 0.0, 0.0); | ||
185 | 136 | compare(shader.visible, false); | ||
186 | 137 | } | ||
187 | 138 | } | ||
188 | 139 | } |
FAILED: Continuous integration, rev:1828 /jenkins. ubuntu. com/ubuntu- sdk/job/ ubuntu- ui-toolkit- ci-amd64/ 205/ /jenkins. ubuntu. com/ubuntu- sdk/job/ generic- update- mp/490/ console
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild: /jenkins. ubuntu. com/ubuntu- sdk/job/ ubuntu- ui-toolkit- ci-amd64/ 205/rebuild
https:/