Merge lp:~aacid/unity8/optimize_card_attribute_creation into lp:unity8

Proposed by Albert Astals Cid
Status: Superseded
Proposed branch: lp:~aacid/unity8/optimize_card_attribute_creation
Merge into: lp:unity8
Diff against target: 1652 lines (+214/-454)
46 files modified
plugins/Dash/CardAttributes.qml (+26/-18)
plugins/Dash/CardCreator.js (+64/-48)
plugins/Dash/CardCreatorCache.qml (+2/-2)
qml/Dash/CardCarousel.qml (+0/-1)
qml/Dash/CardGrid.qml (+0/-2)
qml/Dash/CardTool.qml (+6/-2)
qml/Dash/GenericScopeView.qml (+2/-2)
tests/plugins/Dash/cardcreator/1.res (+8/-26)
tests/plugins/Dash/cardcreator/1.res.cardcreator (+8/-26)
tests/plugins/Dash/cardcreator/1.tst (+1/-0)
tests/plugins/Dash/cardcreator/10.res (+0/-9)
tests/plugins/Dash/cardcreator/10.res.cardcreator (+0/-9)
tests/plugins/Dash/cardcreator/10.tst (+1/-0)
tests/plugins/Dash/cardcreator/11.res (+11/-29)
tests/plugins/Dash/cardcreator/11.res.cardcreator (+10/-28)
tests/plugins/Dash/cardcreator/11.tst (+1/-0)
tests/plugins/Dash/cardcreator/12.res (+8/-26)
tests/plugins/Dash/cardcreator/12.res.cardcreator (+10/-28)
tests/plugins/Dash/cardcreator/12.tst (+1/-0)
tests/plugins/Dash/cardcreator/2.res (+0/-9)
tests/plugins/Dash/cardcreator/2.res.cardcreator (+0/-9)
tests/plugins/Dash/cardcreator/2.tst (+1/-0)
tests/plugins/Dash/cardcreator/3.res (+5/-33)
tests/plugins/Dash/cardcreator/3.res.cardcreator (+5/-33)
tests/plugins/Dash/cardcreator/3.tst (+1/-0)
tests/plugins/Dash/cardcreator/4.res (+1/-2)
tests/plugins/Dash/cardcreator/4.res.cardcreator (+1/-2)
tests/plugins/Dash/cardcreator/4.tst (+1/-0)
tests/plugins/Dash/cardcreator/5.res (+2/-35)
tests/plugins/Dash/cardcreator/5.res.cardcreator (+2/-35)
tests/plugins/Dash/cardcreator/5.tst (+1/-0)
tests/plugins/Dash/cardcreator/6.res (+1/-2)
tests/plugins/Dash/cardcreator/6.res.cardcreator (+1/-2)
tests/plugins/Dash/cardcreator/6.tst (+1/-0)
tests/plugins/Dash/cardcreator/7.res (+0/-9)
tests/plugins/Dash/cardcreator/7.res.cardcreator (+0/-9)
tests/plugins/Dash/cardcreator/7.tst (+1/-0)
tests/plugins/Dash/cardcreator/8.res (+1/-2)
tests/plugins/Dash/cardcreator/8.res.cardcreator (+1/-2)
tests/plugins/Dash/cardcreator/8.tst (+1/-0)
tests/plugins/Dash/cardcreator/9.res (+1/-2)
tests/plugins/Dash/cardcreator/9.res.cardcreator (+1/-2)
tests/plugins/Dash/cardcreator/9.tst (+1/-0)
tests/plugins/Dash/cardcreatortest.cpp (+9/-6)
tests/plugins/Dash/cardcreatortest.qml (+4/-4)
tests/qmltests/Dash/tst_Card.qml (+12/-0)
To merge this branch: bzr merge lp:~aacid/unity8/optimize_card_attribute_creation
Reviewer Review Type Date Requested Status
Unity8 CI Bot continuous-integration Approve
Unity Team Pending
Review via email: mp+295298@code.launchpad.net

This proposal has been superseded by a proposal from 2016-05-23.

Commit message

Do not create Label/Icon if we don't need it

The cards at the store are using a sneaky construct in which half of the attributes are empty to create the attribute layout they want
With this the average creation time for the card attributes on the store scope goes from 8ms to 4ms

Description of the change

 * Are there any related MPs required for this MP to build/function as expected?
No

 * Did you perform an exploratory manual test run of your code change and any related functionality?
Yes

 * If you changed the packaging (debian), did you subscribe the ubuntu-unity team to this MP?
N/A

 * If you changed the UI, has there been a design review?
N/A

To post a comment you must log in.
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :

PASSED: Continuous integration, rev:2400
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/1262/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=vivid+overlay,testname=qmluitests.sh/798
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial+overlay,testname=qmluitests.sh/798
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/1704
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/1654
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial+overlay/1654
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/1647
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/1647/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/1647
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/1647/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/1647
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/1647/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/1647
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/1647/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/1647
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/1647/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/1647
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/1647/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/1262/rebuild

review: Approve (continuous-integration)
2401. By Albert Astals Cid

Merge lp:~aacid/unity8/recoverArtIfChanges

2402. By Albert Astals Cid

Merge

Unmerged revisions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'plugins/Dash/CardAttributes.qml'
2--- plugins/Dash/CardAttributes.qml 2015-07-15 15:13:18 +0000
3+++ plugins/Dash/CardAttributes.qml 2016-05-23 08:06:08 +0000
4@@ -43,28 +43,36 @@
5 Layout.column: index % grid.columns
6 Layout.row: index / grid.columns
7 Layout.columnSpan: index == repeater.count - 1 && grid.columns == 3 && column == 1 ? 2 : 1
8- Layout.maximumWidth: Math.max(icon.width, label.x + label.implicitWidth)
9+ Layout.maximumWidth: Math.max(iconLoader.width, labelLoader.x + labelLoader.implicitWidth)
10 Layout.fillWidth: true
11 height: units.gu(2)
12- Icon {
13- id: icon
14- height: units.gu(2)
15- // FIXME Workaround for bug https://bugs.launchpad.net/ubuntu/+source/ubuntu-ui-toolkit/+bug/1421293
16- width: implicitWidth > 0 && implicitHeight > 0 ? (implicitWidth / implicitHeight * height) : implicitWidth
17- source: "icon" in modelData && modelData["icon"] || ""
18- color: grid.color
19+ Loader {
20+ id: iconLoader
21+ readonly property string source: "icon" in modelData && modelData["icon"] || ""
22+ active: source !== ""
23+ sourceComponent: Icon {
24+ height: units.gu(2)
25+ // FIXME Workaround for bug https://bugs.launchpad.net/ubuntu/+source/ubuntu-ui-toolkit/+bug/1421293
26+ width: implicitWidth > 0 && implicitHeight > 0 ? (implicitWidth / implicitHeight * height) : implicitWidth
27+ source: parent.source
28+ color: grid.color
29+ }
30 }
31- Label {
32- id: label
33+ Loader {
34+ id: labelLoader
35 width: parent.width - x
36- anchors.verticalCenter: parent.verticalCenter
37- text: "value" in modelData && modelData["value"] || "";
38- elide: Text.ElideRight
39- maximumLineCount: 1
40- font.weight: "style" in modelData && modelData["style"] === "highlighted" ? Font.Bold : Font.Light
41- fontSize: "small"
42- font.pixelSize: Math.round(FontUtils.sizeToPixels(fontSize) * fontScale)
43- color: grid.color
44+ readonly property string value: "value" in modelData && modelData["value"] || ""
45+ active: value !== ""
46+ sourceComponent: Label {
47+ anchors.verticalCenter: parent.verticalCenter
48+ text: parent.value
49+ elide: Text.ElideRight
50+ maximumLineCount: 1
51+ font.weight: "style" in modelData && modelData["style"] === "highlighted" ? Font.Bold : Font.Light
52+ fontSize: "small"
53+ font.pixelSize: Math.round(FontUtils.sizeToPixels(fontSize) * fontScale)
54+ color: grid.color
55+ }
56 }
57 }
58 }
59
60=== modified file 'plugins/Dash/CardCreator.js'
61--- plugins/Dash/CardCreator.js 2016-05-04 14:09:00 +0000
62+++ plugins/Dash/CardCreator.js 2016-05-23 08:06:08 +0000
63@@ -59,14 +59,30 @@
64 } \n\
65 }\n';
66
67+// %1 is the aspect of the UbuntuShape
68+var kArtUbuntuShapeCode = 'UbuntuShape { \n\
69+ anchors.fill: parent; \n\
70+ source: artImage; \n\
71+ sourceFillMode: UbuntuShape.PreserveAspectCrop; \n\
72+ radius: "medium"; \n\
73+ aspect: %1; \n\
74+ }';
75+
76+var kArtProportionalShapeCode = 'ProportionalShape { \n\
77+ anchors.fill: parent; \n\
78+ source: artImage; \n\
79+ aspect: UbuntuShape.DropShadow; \n\
80+ }';
81+
82 // %1 is used as anchors of artShapeHolder
83 // %2 is used as image width
84 // %3 is used as image height
85-// %4 is whether the image or the Loader with the UbuntuShape/ProportionalShape should be visible
86+// %4 is whether the image should be visible
87 // %5 is used as aspect ratio fallback
88 // %6 is whether the loader should be asynchronous or not
89-// %7 is injected as code to artImage
90-// %8 is used as image fallback
91+// %7 is the shape code we want to use
92+// %8 is injected as code to artImage
93+// %9 is used as image fallback
94 var kArtShapeHolderCode = 'Item { \n\
95 id: artShapeHolder; \n\
96 height: root.fixedArtShapeSize.height > 0 ? root.fixedArtShapeSize.height : artShapeLoader.height; \n\
97@@ -75,7 +91,8 @@
98 Loader { \n\
99 id: artShapeLoader; \n\
100 objectName: "artShapeLoader"; \n\
101- readonly property string cardArt: cardData && cardData["art"] || %8; \n\
102+ readonly property string cardArt: cardData && cardData["art"] || %9; \n\
103+ onCardArtChanged: { if (item) { item.image.source = cardArt; } } \n\
104 active: cardArt != ""; \n\
105 asynchronous: %6; \n\
106 visible: status == Loader.Ready; \n\
107@@ -84,31 +101,7 @@
108 objectName: "artShape"; \n\
109 visible: image.status == Image.Ready; \n\
110 readonly property alias image: artImage; \n\
111- Loader { \n\
112- anchors.fill: parent; \n\
113- visible: %4; \n\
114- sourceComponent: root.artShapeStyle === "icon" ? artShapeIconComponent : artShapeShapeComponent; \n\
115- Component { \n\
116- id: artShapeShapeComponent; \n\
117- UbuntuShape { \n\
118- source: artImage; \n\
119- sourceFillMode: UbuntuShape.PreserveAspectCrop; \n\
120- radius: "medium"; \n\
121- aspect: { \n\
122- switch (root.artShapeStyle) { \n\
123- case "inset": return UbuntuShape.Inset; \n\
124- case "shadow": return UbuntuShape.DropShadow; \n\
125- default: \n\
126- case "flat": return UbuntuShape.Flat; \n\
127- } \n\
128- } \n\
129- } \n\
130- } \n\
131- Component { \n\
132- id: artShapeIconComponent; \n\
133- ProportionalShape { source: artImage; aspect: UbuntuShape.DropShadow; } \n\
134- } \n\
135- } \n\
136+ %7 \n\
137 readonly property real fixedArtShapeSizeAspect: (root.fixedArtShapeSize.height > 0 && root.fixedArtShapeSize.width > 0) ? root.fixedArtShapeSize.width / root.fixedArtShapeSize.height : -1; \n\
138 readonly property real aspect: fixedArtShapeSizeAspect > 0 ? fixedArtShapeSizeAspect : %5; \n\
139 Component.onCompleted: { updateWidthHeightBindings(); } \n\
140@@ -127,10 +120,10 @@
141 objectName: "artImage"; \n\
142 source: artShapeLoader.cardArt; \n\
143 asynchronous: %6; \n\
144- visible: !%4; \n\
145+ visible: %4; \n\
146 width: %2; \n\
147 height: %3; \n\
148- %7 \n\
149+ %8 \n\
150 } \n\
151 } \n\
152 } \n\
153@@ -318,7 +311,7 @@
154 id: touchdown; \n\
155 objectName: "touchdown"; \n\
156 anchors { %1 } \n\
157- visible: root.artShapeStyle != "shadow" && root.artShapeStyle != "icon" && root.pressed; \n\
158+ visible: root.pressed; \n\
159 radius: "medium"; \n\
160 borderSource: "radius_pressed.sci" \n\
161 }\n';
162@@ -412,7 +405,7 @@
163 return colorString;
164 }
165
166-function cardString(template, components, isCardTool) {
167+function cardString(template, components, isCardTool, artShapeStyle) {
168 var code;
169
170 var templateInteractive = (template == null ? true : (template["non-interactive"] !== undefined ? !template["non-interactive"] : true)) ? "true" : "false";
171@@ -420,7 +413,6 @@
172 code = 'AbstractButton { \n\
173 id: root; \n\
174 property var cardData; \n\
175- property string artShapeStyle: "inset"; \n\
176 property string backgroundShapeStyle: "inset"; \n\
177 property real fontScale: 1.0; \n\
178 property var scopeStyle: null; \n\
179@@ -519,17 +511,35 @@
180 var fallbackStatusCode = "";
181 var fallbackURICode = '""';
182 if (fallback !== "") {
183- // fallbackStatusCode has %6 in it because we want to substitute it for fallbackURICode
184- // which in kArtShapeHolderCode is %8
185- fallbackStatusCode += 'onStatusChanged: if (status === Image.Error) source = %8;';
186+ // fallbackStatusCode has %9 in it because we want to substitute it for fallbackURICode
187+ // which in kArtShapeHolderCode is %9
188+ fallbackStatusCode += 'onStatusChanged: if (status === Image.Error) source = %9;';
189 fallbackURICode = 'decodeURI("%1")'.arg(fallback);
190 }
191+ var artShapeHolderShapeCode;
192+ if (!isConciergeMode) {
193+ if (artShapeStyle === "icon") {
194+ artShapeHolderShapeCode = kArtProportionalShapeCode;
195+ } else {
196+ var artShapeHolderShapeAspect;
197+ switch (artShapeStyle) {
198+ case "inset": artShapeHolderShapeAspect = "UbuntuShape.Inset"; break;
199+ case "shadow": artShapeHolderShapeAspect = "UbuntuShape.DropShadow"; break;
200+ default:
201+ case "flat": artShapeHolderShapeAspect = "UbuntuShape.Flat"; break;
202+ }
203+ artShapeHolderShapeCode = kArtUbuntuShapeCode.arg(artShapeHolderShapeAspect);
204+ }
205+ } else {
206+ artShapeHolderShapeCode = "";
207+ }
208 code += kArtShapeHolderCode.arg(artAnchors)
209 .arg(widthCode)
210 .arg(heightCode)
211- .arg(isConciergeMode ? "false" : "true")
212+ .arg(isConciergeMode ? "true" : "false")
213 .arg(aspectRatio)
214 .arg(asynchronous)
215+ .arg(artShapeHolderShapeCode)
216 .arg(fallbackStatusCode)
217 .arg(fallbackURICode);
218 } else {
219@@ -854,6 +864,10 @@
220 code += kSummaryLabelCode.arg(summaryTopAnchor).arg(summaryTopMargin).arg(summaryColor);
221 }
222
223+// <<<<<<< TREE
224+// if (artShapeStyle != "shadow" && artShapeStyle != "icon") {
225+// var touchdownAnchors;
226+// =======
227 if (hasSocialActions) {
228 var socialAnchors;
229 var socialTopAnchor;
230@@ -882,15 +896,17 @@
231 code += kSocialActionsRowCode.arg(socialAnchors).arg(socialColor);
232 }
233
234- var touchdownAnchors;
235- if (hasBackground) {
236- touchdownAnchors = 'fill: backgroundLoader';
237- } else if (touchdownOnArtShape) {
238- touchdownAnchors = 'fill: artShapeHolder';
239- } else {
240- touchdownAnchors = 'fill: root'
241+ if (artShapeStyle != "shadow" && artShapeStyle != "icon") {
242+ var touchdownAnchors;
243+ if (hasBackground) {
244+ touchdownAnchors = 'fill: backgroundLoader';
245+ } else if (touchdownOnArtShape) {
246+ touchdownAnchors = 'fill: artShapeHolder';
247+ } else {
248+ touchdownAnchors = 'fill: root'
249+ }
250+ code += kTouchdownCode.arg(touchdownAnchors);
251 }
252- code += kTouchdownCode.arg(touchdownAnchors);
253
254 var implicitHeight = 'implicitHeight: ';
255 if (hasSocialActions) {
256@@ -925,13 +941,13 @@
257 return code;
258 }
259
260-function createCardComponent(parent, template, components, isCardTool, identifier) {
261+function createCardComponent(parent, template, components, isCardTool, artShapeStyle, identifier) {
262 var imports = 'import QtQuick 2.4; \n\
263 import Ubuntu.Components 1.3; \n\
264 import Ubuntu.Settings.Components 0.1; \n\
265 import Dash 0.1;\n\
266 import Utils 0.1;\n';
267- var card = cardString(template, components, isCardTool);
268+ var card = cardString(template, components, isCardTool, artShapeStyle);
269 var code = imports + 'Component {\n' + card + '}\n';
270
271 try {
272
273=== modified file 'plugins/Dash/CardCreatorCache.qml'
274--- plugins/Dash/CardCreatorCache.qml 2016-02-16 14:26:58 +0000
275+++ plugins/Dash/CardCreatorCache.qml 2016-05-23 08:06:08 +0000
276@@ -23,7 +23,7 @@
277
278 property var cache: new Object();
279
280- function getCardComponent(template, components, isCardTool) {
281+ function getCardComponent(template, components, isCardTool, artShapeStyle) {
282 if (template === undefined || components === undefined)
283 return undefined;
284
285@@ -32,7 +32,7 @@
286 var allString = tString + cString + isCardTool;
287 var component = cache[allString];
288 if (component === undefined) {
289- component = CardCreator.createCardComponent(root, template, components, isCardTool, allString);
290+ component = CardCreator.createCardComponent(root, template, components, isCardTool, artShapeStyle, allString);
291 cache[allString] = component;
292 }
293 return component;
294
295=== modified file 'qml/Dash/CardCarousel.qml'
296--- qml/Dash/CardCarousel.qml 2016-02-16 15:09:55 +0000
297+++ qml/Dash/CardCarousel.qml 2016-05-23 08:06:08 +0000
298@@ -66,7 +66,6 @@
299 item.cardData = Qt.binding(function() { return model; });
300 item.fontScale = Qt.binding(function() { return carousel.fontScale; });
301 item.showHeader = Qt.binding(function() { return loader.explicitlyScaled; });
302- item.artShapeStyle = "shadow";
303 item.scopeStyle = cardCarousel.scopeStyle;
304 }
305 }
306
307=== modified file 'qml/Dash/CardGrid.qml'
308--- qml/Dash/CardGrid.qml 2016-03-07 12:39:23 +0000
309+++ qml/Dash/CardGrid.qml 2016-05-23 08:06:08 +0000
310@@ -25,7 +25,6 @@
311 if (!cardTool || !cardTool.template || typeof cardTool.template["collapsed-rows"] != "number") return 2;
312 return cardTool.template["collapsed-rows"];
313 }
314- property string artShapeStyle: "inset";
315 property string backgroundShapeStyle: "inset";
316 property alias minimumHorizontalSpacing: grid.minimumHorizontalSpacing
317
318@@ -71,7 +70,6 @@
319 item.fixedArtShapeSize = Qt.binding(function() { return cardTool.artShapeSize; });
320 item.cardData = Qt.binding(function() { return model; });
321 item.scopeStyle = root.scopeStyle;
322- item.artShapeStyle = root.artShapeStyle;
323 item.backgroundShapeStyle = root.backgroundShapeStyle;
324 }
325 Connections {
326
327=== modified file 'qml/Dash/CardTool.qml'
328--- qml/Dash/CardTool.qml 2016-04-06 16:19:57 +0000
329+++ qml/Dash/CardTool.qml 2016-05-23 08:06:08 +0000
330@@ -66,7 +66,11 @@
331 return layout;
332 }
333
334- property var cardComponent: CardCreatorCache.getCardComponent(cardTool.template, cardTool.components, false);
335+
336+ // Not readonly because gets overwritten from GenericScopeView in some cases
337+ property string artShapeStyle: categoryLayout === "carousel" ? "shadow" : "inset"
338+
339+ property var cardComponent: CardCreatorCache.getCardComponent(cardTool.template, cardTool.components, false, artShapeStyle);
340
341 // FIXME: Saviq
342 // Only way for the card below to actually be laid out completely.
343@@ -208,7 +212,7 @@
344 "attributes": attributesModel.model,
345 "socialActions": socialActionsModel.model
346 }
347- sourceComponent: CardCreatorCache.getCardComponent(cardTool.template, cardTool.components, true);
348+ sourceComponent: CardCreatorCache.getCardComponent(cardTool.template, cardTool.components, true, artShapeStyle);
349 onLoaded: {
350 item.objectName = "cardToolCard";
351 item.width = Qt.binding(function() { return cardTool.cardWidth !== -1 ? cardTool.cardWidth : item.implicitWidth; });
352
353=== modified file 'qml/Dash/GenericScopeView.qml'
354--- qml/Dash/GenericScopeView.qml 2016-05-04 18:08:35 +0000
355+++ qml/Dash/GenericScopeView.qml 2016-05-23 08:06:08 +0000
356@@ -345,10 +345,10 @@
357 if (scope && scope.id === "clickscope") {
358 if (categoryId === "predefined" || categoryId === "local") {
359 cardTool.artShapeSize = Qt.binding(function() { return Qt.size(units.gu(8), units.gu(7.5)) });
360- item.artShapeStyle = "icon";
361+ cardTool.artShapeStyle = "icon";
362 } else {
363 // Should be ubuntu store icon
364- item.artShapeStyle = "flat";
365+ cardTool.artShapeStyle = "flat";
366 item.backgroundShapeStyle = "shadow";
367 }
368 }
369
370=== modified file 'tests/plugins/Dash/cardcreator/1.res'
371--- tests/plugins/Dash/cardcreator/1.res 2016-05-04 14:09:00 +0000
372+++ tests/plugins/Dash/cardcreator/1.res 2016-05-23 08:06:08 +0000
373@@ -1,7 +1,6 @@
374 AbstractButton {
375 id: root;
376 property var cardData;
377- property string artShapeStyle: "inset";
378 property string backgroundShapeStyle: "inset";
379 property real fontScale: 1.0;
380 property var scopeStyle: null;
381@@ -22,6 +21,7 @@
382 id: artShapeLoader;
383 objectName: "artShapeLoader";
384 readonly property string cardArt: cardData && cardData["art"] || "";
385+ onCardArtChanged: { if (item) { item.image.source = cardArt; } }
386 active: cardArt != "";
387 asynchronous: true;
388 visible: status == Loader.Ready;
389@@ -30,30 +30,12 @@
390 objectName: "artShape";
391 visible: image.status == Image.Ready;
392 readonly property alias image: artImage;
393- Loader {
394+ UbuntuShape {
395 anchors.fill: parent;
396- visible: true;
397- sourceComponent: root.artShapeStyle === "icon" ? artShapeIconComponent : artShapeShapeComponent;
398- Component {
399- id: artShapeShapeComponent;
400- UbuntuShape {
401- source: artImage;
402- sourceFillMode: UbuntuShape.PreserveAspectCrop;
403- radius: "medium";
404- aspect: {
405- switch (root.artShapeStyle) {
406- case "inset": return UbuntuShape.Inset;
407- case "shadow": return UbuntuShape.DropShadow;
408- default:
409- case "flat": return UbuntuShape.Flat;
410- }
411- }
412- }
413- }
414- Component {
415- id: artShapeIconComponent;
416- ProportionalShape { source: artImage; aspect: UbuntuShape.DropShadow; }
417- }
418+ source: artImage;
419+ sourceFillMode: UbuntuShape.PreserveAspectCrop;
420+ radius: "medium";
421+ aspect: UbuntuShape.Inset;
422 }
423 readonly property real fixedArtShapeSizeAspect: (root.fixedArtShapeSize.height > 0 && root.fixedArtShapeSize.width > 0) ? root.fixedArtShapeSize.width / root.fixedArtShapeSize.height : -1;
424 readonly property real aspect: fixedArtShapeSizeAspect > 0 ? fixedArtShapeSizeAspect : 1.6;
425@@ -73,7 +55,7 @@
426 objectName: "artImage";
427 source: artShapeLoader.cardArt;
428 asynchronous: true;
429- visible: !true;
430+ visible: false;
431 width: root.width;
432 height: width / artShape.aspect;
433 }
434@@ -105,7 +87,7 @@
435 id: touchdown;
436 objectName: "touchdown";
437 anchors { fill: artShapeHolder }
438- visible: root.artShapeStyle != "shadow" && root.artShapeStyle != "icon" && root.pressed;
439+ visible: root.pressed;
440 radius: "medium";
441 borderSource: "radius_pressed.sci"
442 }
443
444=== modified file 'tests/plugins/Dash/cardcreator/1.res.cardcreator'
445--- tests/plugins/Dash/cardcreator/1.res.cardcreator 2016-05-04 14:09:00 +0000
446+++ tests/plugins/Dash/cardcreator/1.res.cardcreator 2016-05-23 08:06:08 +0000
447@@ -1,7 +1,6 @@
448 AbstractButton {
449 id: root;
450 property var cardData;
451- property string artShapeStyle: "inset";
452 property string backgroundShapeStyle: "inset";
453 property real fontScale: 1.0;
454 property var scopeStyle: null;
455@@ -21,6 +20,7 @@
456 id: artShapeLoader;
457 objectName: "artShapeLoader";
458 readonly property string cardArt: cardData && cardData["art"] || "";
459+ onCardArtChanged: { if (item) { item.image.source = cardArt; } }
460 active: cardArt != "";
461 asynchronous: false;
462 visible: status == Loader.Ready;
463@@ -29,30 +29,12 @@
464 objectName: "artShape";
465 visible: image.status == Image.Ready;
466 readonly property alias image: artImage;
467- Loader {
468+ UbuntuShape {
469 anchors.fill: parent;
470- visible: true;
471- sourceComponent: root.artShapeStyle === "icon" ? artShapeIconComponent : artShapeShapeComponent;
472- Component {
473- id: artShapeShapeComponent;
474- UbuntuShape {
475- source: artImage;
476- sourceFillMode: UbuntuShape.PreserveAspectCrop;
477- radius: "medium";
478- aspect: {
479- switch (root.artShapeStyle) {
480- case "inset": return UbuntuShape.Inset;
481- case "shadow": return UbuntuShape.DropShadow;
482- default:
483- case "flat": return UbuntuShape.Flat;
484- }
485- }
486- }
487- }
488- Component {
489- id: artShapeIconComponent;
490- ProportionalShape { source: artImage; aspect: UbuntuShape.DropShadow; }
491- }
492+ source: artImage;
493+ sourceFillMode: UbuntuShape.PreserveAspectCrop;
494+ radius: "medium";
495+ aspect: UbuntuShape.Inset;
496 }
497 readonly property real fixedArtShapeSizeAspect: (root.fixedArtShapeSize.height > 0 && root.fixedArtShapeSize.width > 0) ? root.fixedArtShapeSize.width / root.fixedArtShapeSize.height : -1;
498 readonly property real aspect: fixedArtShapeSizeAspect > 0 ? fixedArtShapeSizeAspect : 1.6;
499@@ -72,7 +54,7 @@
500 objectName: "artImage";
501 source: artShapeLoader.cardArt;
502 asynchronous: false;
503- visible: !true;
504+ visible: false;
505 width: root.width;
506 height: width / artShape.aspect;
507 }
508@@ -104,7 +86,7 @@
509 id: touchdown;
510 objectName: "touchdown";
511 anchors { fill: artShapeHolder }
512- visible: root.artShapeStyle != "shadow" && root.artShapeStyle != "icon" && root.pressed;
513+ visible: root.pressed;
514 radius: "medium";
515 borderSource: "radius_pressed.sci"
516 }
517
518=== modified file 'tests/plugins/Dash/cardcreator/1.tst'
519--- tests/plugins/Dash/cardcreator/1.tst 2014-08-08 08:54:12 +0000
520+++ tests/plugins/Dash/cardcreator/1.tst 2016-05-23 08:06:08 +0000
521@@ -1,3 +1,4 @@
522 template: {"card-layout":"vertical","card-size":"small","category-layout":"grid","collapsed-rows":2}
523 components: {"art":{"aspect-ratio":1.6,"field":"art"},"title":{"field":"title"},"attributes":{}}
524+artShapeStyle: inset
525 result: 1.res
526
527=== modified file 'tests/plugins/Dash/cardcreator/10.res'
528--- tests/plugins/Dash/cardcreator/10.res 2016-03-07 12:39:23 +0000
529+++ tests/plugins/Dash/cardcreator/10.res 2016-05-23 08:06:08 +0000
530@@ -1,7 +1,6 @@
531 AbstractButton {
532 id: root;
533 property var cardData;
534- property string artShapeStyle: "inset";
535 property string backgroundShapeStyle: "inset";
536 property real fontScale: 1.0;
537 property var scopeStyle: null;
538@@ -127,13 +126,5 @@
539
540 ]
541 }
542-UbuntuShape {
543- id: touchdown;
544- objectName: "touchdown";
545- anchors { fill: backgroundLoader }
546- visible: root.artShapeStyle != "shadow" && root.artShapeStyle != "icon" && root.pressed;
547- radius: "medium";
548- borderSource: "radius_pressed.sci"
549- }
550 implicitHeight: row.y + row.height + units.gu(1);
551 }
552
553=== modified file 'tests/plugins/Dash/cardcreator/10.res.cardcreator'
554--- tests/plugins/Dash/cardcreator/10.res.cardcreator 2016-03-07 12:39:23 +0000
555+++ tests/plugins/Dash/cardcreator/10.res.cardcreator 2016-05-23 08:06:08 +0000
556@@ -1,7 +1,6 @@
557 AbstractButton {
558 id: root;
559 property var cardData;
560- property string artShapeStyle: "inset";
561 property string backgroundShapeStyle: "inset";
562 property real fontScale: 1.0;
563 property var scopeStyle: null;
564@@ -125,13 +124,5 @@
565
566 ]
567 }
568-UbuntuShape {
569- id: touchdown;
570- objectName: "touchdown";
571- anchors { fill: backgroundLoader }
572- visible: root.artShapeStyle != "shadow" && root.artShapeStyle != "icon" && root.pressed;
573- radius: "medium";
574- borderSource: "radius_pressed.sci"
575- }
576 implicitHeight: row.y + row.height + units.gu(1);
577 }
578
579=== modified file 'tests/plugins/Dash/cardcreator/10.tst'
580--- tests/plugins/Dash/cardcreator/10.tst 2016-01-25 16:49:26 +0000
581+++ tests/plugins/Dash/cardcreator/10.tst 2016-05-23 08:06:08 +0000
582@@ -1,3 +1,4 @@
583 template: {"card-background":{"elements":["#E9E9E9"],"type":"color"},"card-layout":"vertical","card-size":"medium","category-layout":"grid","collapsed-rows":2, "card-background": { "type": "color", "elements": [ "\\", ": 3; } Item { } function moo () { \"" ] } }
584 components: {"art":{"aspect-ratio":1},"background":{"field":"background"},"mascot":{"field":"icon"},"subtitle":{"field":"author"},"title":{"field":"title"},"attributes":{}}
585+artShapeStyle: shadow
586 result: 10.res
587\ No newline at end of file
588
589=== modified file 'tests/plugins/Dash/cardcreator/11.res'
590--- tests/plugins/Dash/cardcreator/11.res 2016-05-04 14:09:00 +0000
591+++ tests/plugins/Dash/cardcreator/11.res 2016-05-23 08:06:08 +0000
592@@ -1,7 +1,6 @@
593 AbstractButton {
594 id: root;
595 property var cardData;
596- property string artShapeStyle: "inset";
597 property string backgroundShapeStyle: "inset";
598 property real fontScale: 1.0;
599 property var scopeStyle: null;
600@@ -60,6 +59,7 @@
601 id: artShapeLoader;
602 objectName: "artShapeLoader";
603 readonly property string cardArt: cardData && cardData["art"] || decodeURI("%5C");
604+ onCardArtChanged: { if (item) { item.image.source = cardArt; } }
605 active: cardArt != "";
606 asynchronous: true;
607 visible: status == Loader.Ready;
608@@ -68,32 +68,14 @@
609 objectName: "artShape";
610 visible: image.status == Image.Ready;
611 readonly property alias image: artImage;
612- Loader {
613- anchors.fill: parent;
614- visible: true;
615- sourceComponent: root.artShapeStyle === "icon" ? artShapeIconComponent : artShapeShapeComponent;
616- Component {
617- id: artShapeShapeComponent;
618- UbuntuShape {
619- source: artImage;
620- sourceFillMode: UbuntuShape.PreserveAspectCrop;
621- radius: "medium";
622- aspect: {
623- switch (root.artShapeStyle) {
624- case "inset": return UbuntuShape.Inset;
625- case "shadow": return UbuntuShape.DropShadow;
626- default:
627- case "flat": return UbuntuShape.Flat;
628- }
629- }
630- }
631- }
632- Component {
633- id: artShapeIconComponent;
634- ProportionalShape { source: artImage; aspect: UbuntuShape.DropShadow; }
635- }
636- }
637- readonly property real fixedArtShapeSizeAspect: (root.fixedArtShapeSize.height > 0 && root.fixedArtShapeSize.width > 0) ? root.fixedArtShapeSize.width / root.fixedArtShapeSize.height : -1;
638+ UbuntuShape {
639+ anchors.fill: parent;
640+ source: artImage;
641+ sourceFillMode: UbuntuShape.PreserveAspectCrop;
642+ radius: "medium";
643+ aspect: UbuntuShape.Flat;
644+ }
645+ readonly property real fixedArtShapeSizeAspect: (root.fixedArtShapeSize.height > 0 && root.fixedArtShapeSize.width > 0) ? root.fixedArtShapeSize.width / root.fixedArtShapeSize.height : -1;
646 readonly property real aspect: fixedArtShapeSizeAspect > 0 ? fixedArtShapeSizeAspect : 1;
647 Component.onCompleted: { updateWidthHeightBindings(); }
648 Connections { target: root; onFixedArtShapeSizeChanged: updateWidthHeightBindings(); }
649@@ -111,7 +93,7 @@
650 objectName: "artImage";
651 source: artShapeLoader.cardArt;
652 asynchronous: true;
653- visible: !true;
654+ visible: false;
655 width: root.width;
656 height: width / artShape.aspect;
657 onStatusChanged: if (status === Image.Error) source = decodeURI("%5C");
658@@ -199,7 +181,7 @@
659 id: touchdown;
660 objectName: "touchdown";
661 anchors { fill: backgroundLoader }
662- visible: root.artShapeStyle != "shadow" && root.artShapeStyle != "icon" && root.pressed;
663+ visible: root.pressed;
664 radius: "medium";
665 borderSource: "radius_pressed.sci"
666 }
667
668=== modified file 'tests/plugins/Dash/cardcreator/11.res.cardcreator'
669--- tests/plugins/Dash/cardcreator/11.res.cardcreator 2016-05-04 14:09:00 +0000
670+++ tests/plugins/Dash/cardcreator/11.res.cardcreator 2016-05-23 08:06:08 +0000
671@@ -1,7 +1,6 @@
672 AbstractButton {
673 id: root;
674 property var cardData;
675- property string artShapeStyle: "inset";
676 property string backgroundShapeStyle: "inset";
677 property real fontScale: 1.0;
678 property var scopeStyle: null;
679@@ -59,6 +58,7 @@
680 id: artShapeLoader;
681 objectName: "artShapeLoader";
682 readonly property string cardArt: cardData && cardData["art"] || "";
683+ onCardArtChanged: { if (item) { item.image.source = cardArt; } }
684 active: cardArt != "";
685 asynchronous: false;
686 visible: status == Loader.Ready;
687@@ -67,31 +67,13 @@
688 objectName: "artShape";
689 visible: image.status == Image.Ready;
690 readonly property alias image: artImage;
691- Loader {
692- anchors.fill: parent;
693- visible: true;
694- sourceComponent: root.artShapeStyle === "icon" ? artShapeIconComponent : artShapeShapeComponent;
695- Component {
696- id: artShapeShapeComponent;
697- UbuntuShape {
698- source: artImage;
699- sourceFillMode: UbuntuShape.PreserveAspectCrop;
700- radius: "medium";
701- aspect: {
702- switch (root.artShapeStyle) {
703- case "inset": return UbuntuShape.Inset;
704- case "shadow": return UbuntuShape.DropShadow;
705- default:
706- case "flat": return UbuntuShape.Flat;
707- }
708- }
709- }
710- }
711- Component {
712- id: artShapeIconComponent;
713- ProportionalShape { source: artImage; aspect: UbuntuShape.DropShadow; }
714- }
715- }
716+ UbuntuShape {
717+ anchors.fill: parent;
718+ source: artImage;
719+ sourceFillMode: UbuntuShape.PreserveAspectCrop;
720+ radius: "medium";
721+ aspect: UbuntuShape.Flat;
722+ }
723 readonly property real fixedArtShapeSizeAspect: (root.fixedArtShapeSize.height > 0 && root.fixedArtShapeSize.width > 0) ? root.fixedArtShapeSize.width / root.fixedArtShapeSize.height : -1;
724 readonly property real aspect: fixedArtShapeSizeAspect > 0 ? fixedArtShapeSizeAspect : 1;
725 Component.onCompleted: { updateWidthHeightBindings(); }
726@@ -110,7 +92,7 @@
727 objectName: "artImage";
728 source: artShapeLoader.cardArt;
729 asynchronous: false;
730- visible: !true;
731+ visible: false;
732 width: root.width;
733 height: width / artShape.aspect;
734 }
735@@ -195,7 +177,7 @@
736 id: touchdown;
737 objectName: "touchdown";
738 anchors { fill: backgroundLoader }
739- visible: root.artShapeStyle != "shadow" && root.artShapeStyle != "icon" && root.pressed;
740+ visible: root.pressed;
741 radius: "medium";
742 borderSource: "radius_pressed.sci"
743 }
744
745=== modified file 'tests/plugins/Dash/cardcreator/11.tst'
746--- tests/plugins/Dash/cardcreator/11.tst 2016-01-25 16:49:26 +0000
747+++ tests/plugins/Dash/cardcreator/11.tst 2016-05-23 08:06:08 +0000
748@@ -1,3 +1,4 @@
749 template: {"card-background":{"elements":["#E9E9E9"],"type":"color"},"card-layout":"vertical","card-size":"medium","category-layout":"grid","collapsed-rows":2 }
750 components: {"art":{"aspect-ratio":1,"field":"art","fallback":"\\"},"background":{"field":"background"},"mascot":{"field":"icon","fallback":"\""},"subtitle":{"field":"author"},"title":{"field":"title"},"attributes":{}}
751+artShapeStyle: flat
752 result: 11.res
753\ No newline at end of file
754
755=== modified file 'tests/plugins/Dash/cardcreator/12.res'
756--- tests/plugins/Dash/cardcreator/12.res 2016-05-04 14:25:02 +0000
757+++ tests/plugins/Dash/cardcreator/12.res 2016-05-23 08:06:08 +0000
758@@ -1,7 +1,6 @@
759 AbstractButton {
760 id: root;
761 property var cardData;
762- property string artShapeStyle: "inset";
763 property string backgroundShapeStyle: "inset";
764 property real fontScale: 1.0;
765 property var scopeStyle: null;
766@@ -22,6 +21,7 @@
767 id: artShapeLoader;
768 objectName: "artShapeLoader";
769 readonly property string cardArt: cardData && cardData["art"] || "";
770+ onCardArtChanged: { if (item) { item.image.source = cardArt; } }
771 active: cardArt != "";
772 asynchronous: true;
773 visible: status == Loader.Ready;
774@@ -30,30 +30,12 @@
775 objectName: "artShape";
776 visible: image.status == Image.Ready;
777 readonly property alias image: artImage;
778- Loader {
779+ UbuntuShape {
780 anchors.fill: parent;
781- visible: true;
782- sourceComponent: root.artShapeStyle === "icon" ? artShapeIconComponent : artShapeShapeComponent;
783- Component {
784- id: artShapeShapeComponent;
785- UbuntuShape {
786- source: artImage;
787- sourceFillMode: UbuntuShape.PreserveAspectCrop;
788- radius: "medium";
789- aspect: {
790- switch (root.artShapeStyle) {
791- case "inset": return UbuntuShape.Inset;
792- case "shadow": return UbuntuShape.DropShadow;
793- default:
794- case "flat": return UbuntuShape.Flat;
795- }
796- }
797- }
798- }
799- Component {
800- id: artShapeIconComponent;
801- ProportionalShape { source: artImage; aspect: UbuntuShape.DropShadow; }
802- }
803+ source: artImage;
804+ sourceFillMode: UbuntuShape.PreserveAspectCrop;
805+ radius: "medium";
806+ aspect: UbuntuShape.Flat;
807 }
808 readonly property real fixedArtShapeSizeAspect: (root.fixedArtShapeSize.height > 0 && root.fixedArtShapeSize.width > 0) ? root.fixedArtShapeSize.width / root.fixedArtShapeSize.height : -1;
809 readonly property real aspect: fixedArtShapeSizeAspect > 0 ? fixedArtShapeSizeAspect : 0.75;
810@@ -73,7 +55,7 @@
811 objectName: "artImage";
812 source: artShapeLoader.cardArt;
813 asynchronous: true;
814- visible: !true;
815+ visible: false;
816 width: root.width;
817 height: width / artShape.aspect;
818 }
819@@ -131,7 +113,7 @@
820 id: touchdown;
821 objectName: "touchdown";
822 anchors { fill: artShapeHolder }
823- visible: root.artShapeStyle != "shadow" && root.artShapeStyle != "icon" && root.pressed;
824+ visible: root.pressed;
825 radius: "medium";
826 borderSource: "radius_pressed.sci"
827 }
828
829=== modified file 'tests/plugins/Dash/cardcreator/12.res.cardcreator'
830--- tests/plugins/Dash/cardcreator/12.res.cardcreator 2016-05-04 14:25:02 +0000
831+++ tests/plugins/Dash/cardcreator/12.res.cardcreator 2016-05-23 08:06:08 +0000
832@@ -1,7 +1,6 @@
833-AbstractButton {
834+AbstractButton {
835 id: root;
836 property var cardData;
837- property string artShapeStyle: "inset";
838 property string backgroundShapeStyle: "inset";
839 property real fontScale: 1.0;
840 property var scopeStyle: null;
841@@ -17,10 +16,11 @@
842 height: root.fixedArtShapeSize.height > 0 ? root.fixedArtShapeSize.height : artShapeLoader.height;
843 width: root.fixedArtShapeSize.width > 0 ? root.fixedArtShapeSize.width : artShapeLoader.width;
844 anchors { horizontalCenter: parent.horizontalCenter; }
845- Loader {
846+ Loader {
847 id: artShapeLoader;
848 objectName: "artShapeLoader";
849 readonly property string cardArt: cardData && cardData["art"] || "";
850+ onCardArtChanged: { if (item) { item.image.source = cardArt; } }
851 active: cardArt != "";
852 asynchronous: false;
853 visible: status == Loader.Ready;
854@@ -29,30 +29,12 @@
855 objectName: "artShape";
856 visible: image.status == Image.Ready;
857 readonly property alias image: artImage;
858- Loader {
859+ UbuntuShape {
860 anchors.fill: parent;
861- visible: true;
862- sourceComponent: root.artShapeStyle === "icon" ? artShapeIconComponent : artShapeShapeComponent;
863- Component {
864- id: artShapeShapeComponent;
865- UbuntuShape {
866- source: artImage;
867- sourceFillMode: UbuntuShape.PreserveAspectCrop;
868- radius: "medium";
869- aspect: {
870- switch (root.artShapeStyle) {
871- case "inset": return UbuntuShape.Inset;
872- case "shadow": return UbuntuShape.DropShadow;
873- default:
874- case "flat": return UbuntuShape.Flat;
875- }
876- }
877- }
878- }
879- Component {
880- id: artShapeIconComponent;
881- ProportionalShape { source: artImage; aspect: UbuntuShape.DropShadow; }
882- }
883+ source: artImage;
884+ sourceFillMode: UbuntuShape.PreserveAspectCrop;
885+ radius: "medium";
886+ aspect: UbuntuShape.Flat;
887 }
888 readonly property real fixedArtShapeSizeAspect: (root.fixedArtShapeSize.height > 0 && root.fixedArtShapeSize.width > 0) ? root.fixedArtShapeSize.width / root.fixedArtShapeSize.height : -1;
889 readonly property real aspect: fixedArtShapeSizeAspect > 0 ? fixedArtShapeSizeAspect : 0.75;
890@@ -72,7 +54,7 @@
891 objectName: "artImage";
892 source: artShapeLoader.cardArt;
893 asynchronous: false;
894- visible: !true;
895+ visible: false;
896 width: root.width;
897 height: width / artShape.aspect;
898 }
899@@ -130,7 +112,7 @@
900 id: touchdown;
901 objectName: "touchdown";
902 anchors { fill: artShapeHolder }
903- visible: root.artShapeStyle != "shadow" && root.artShapeStyle != "icon" && root.pressed;
904+ visible: root.pressed;
905 radius: "medium";
906 borderSource: "radius_pressed.sci"
907 }
908
909=== modified file 'tests/plugins/Dash/cardcreator/12.tst'
910--- tests/plugins/Dash/cardcreator/12.tst 2016-03-21 16:06:10 +0000
911+++ tests/plugins/Dash/cardcreator/12.tst 2016-05-23 08:06:08 +0000
912@@ -1,3 +1,4 @@
913 template: {"card-layout":"vertical","card-size":"small","category-layout":"grid","collapsed-rows":2}
914 components: {"art":{"aspect-ratio":0.75,"field":"art"},"subtitle":{"field":"price"},"title":{"field":"title"},"attributes":{},"social-actions":{}}
915+artShapeStyle: flat
916 result: 12.res
917
918=== modified file 'tests/plugins/Dash/cardcreator/2.res'
919--- tests/plugins/Dash/cardcreator/2.res 2016-03-07 12:39:23 +0000
920+++ tests/plugins/Dash/cardcreator/2.res 2016-05-23 08:06:08 +0000
921@@ -1,7 +1,6 @@
922 AbstractButton {
923 id: root;
924 property var cardData;
925- property string artShapeStyle: "inset";
926 property string backgroundShapeStyle: "inset";
927 property real fontScale: 1.0;
928 property var scopeStyle: null;
929@@ -126,13 +125,5 @@
930
931 ]
932 }
933-UbuntuShape {
934- id: touchdown;
935- objectName: "touchdown";
936- anchors { fill: backgroundLoader }
937- visible: root.artShapeStyle != "shadow" && root.artShapeStyle != "icon" && root.pressed;
938- radius: "medium";
939- borderSource: "radius_pressed.sci"
940-}
941 implicitHeight: row.y + row.height + units.gu(1);
942 }
943
944=== modified file 'tests/plugins/Dash/cardcreator/2.res.cardcreator'
945--- tests/plugins/Dash/cardcreator/2.res.cardcreator 2016-03-07 12:39:23 +0000
946+++ tests/plugins/Dash/cardcreator/2.res.cardcreator 2016-05-23 08:06:08 +0000
947@@ -1,7 +1,6 @@
948 AbstractButton {
949 id: root;
950 property var cardData;
951- property string artShapeStyle: "inset";
952 property string backgroundShapeStyle: "inset";
953 property real fontScale: 1.0;
954 property var scopeStyle: null;
955@@ -124,13 +123,5 @@
956
957 ]
958 }
959-UbuntuShape {
960- id: touchdown;
961- objectName: "touchdown";
962- anchors { fill: backgroundLoader }
963- visible: root.artShapeStyle != "shadow" && root.artShapeStyle != "icon" && root.pressed;
964- radius: "medium";
965- borderSource: "radius_pressed.sci"
966-}
967 implicitHeight: row.y + row.height + units.gu(1);
968 }
969
970=== modified file 'tests/plugins/Dash/cardcreator/2.tst'
971--- tests/plugins/Dash/cardcreator/2.tst 2014-08-08 08:54:12 +0000
972+++ tests/plugins/Dash/cardcreator/2.tst 2016-05-23 08:06:08 +0000
973@@ -1,3 +1,4 @@
974 template: {"card-background":{"elements":["#E9E9E9"],"type":"color"},"card-layout":"vertical","card-size":"medium","category-layout":"grid","collapsed-rows":2}
975 components: {"art":{"aspect-ratio":1},"background":{"field":"background"},"mascot":{"field":"icon"},"subtitle":{"field":"author"},"title":{"field":"title"},"attributes":{}}
976+artShapeStyle: icon
977 result: 2.res
978
979=== modified file 'tests/plugins/Dash/cardcreator/3.res'
980--- tests/plugins/Dash/cardcreator/3.res 2016-05-04 14:09:00 +0000
981+++ tests/plugins/Dash/cardcreator/3.res 2016-05-23 08:06:08 +0000
982@@ -1,7 +1,6 @@
983 AbstractButton {
984 id: root;
985 property var cardData;
986- property string artShapeStyle: "inset";
987 property string backgroundShapeStyle: "inset";
988 property real fontScale: 1.0;
989 property var scopeStyle: null;
990@@ -22,6 +21,7 @@
991 id: artShapeLoader;
992 objectName: "artShapeLoader";
993 readonly property string cardArt: cardData && cardData["art"] || decodeURI("IHAVE%5C%22ESCAPED%5C%22QUOTES%5C%22");
994+ onCardArtChanged: { if (item) { item.image.source = cardArt; } }
995 active: cardArt != "";
996 asynchronous: true;
997 visible: status == Loader.Ready;
998@@ -30,30 +30,10 @@
999 objectName: "artShape";
1000 visible: image.status == Image.Ready;
1001 readonly property alias image: artImage;
1002- Loader {
1003+ ProportionalShape {
1004 anchors.fill: parent;
1005- visible: true;
1006- sourceComponent: root.artShapeStyle === "icon" ? artShapeIconComponent : artShapeShapeComponent;
1007- Component {
1008- id: artShapeShapeComponent;
1009- UbuntuShape {
1010- source: artImage;
1011- sourceFillMode: UbuntuShape.PreserveAspectCrop;
1012- radius: "medium";
1013- aspect: {
1014- switch (root.artShapeStyle) {
1015- case "inset": return UbuntuShape.Inset;
1016- case "shadow": return UbuntuShape.DropShadow;
1017- default:
1018- case "flat": return UbuntuShape.Flat;
1019- }
1020- }
1021- }
1022- }
1023- Component {
1024- id: artShapeIconComponent;
1025- ProportionalShape { source: artImage; aspect: UbuntuShape.DropShadow; }
1026- }
1027+ source: artImage;
1028+ aspect: UbuntuShape.DropShadow;
1029 }
1030 readonly property real fixedArtShapeSizeAspect: (root.fixedArtShapeSize.height > 0 && root.fixedArtShapeSize.width > 0) ? root.fixedArtShapeSize.width / root.fixedArtShapeSize.height : -1;
1031 readonly property real aspect: fixedArtShapeSizeAspect > 0 ? fixedArtShapeSizeAspect : 0.75;
1032@@ -73,7 +53,7 @@
1033 objectName: "artImage";
1034 source: artShapeLoader.cardArt;
1035 asynchronous: true;
1036- visible: !true;
1037+ visible: false;
1038 width: root.width;
1039 height: width / artShape.aspect;
1040 onStatusChanged: if (status === Image.Error) source = decodeURI("IHAVE%5C%22ESCAPED%5C%22QUOTES%5C%22");
1041@@ -120,13 +100,5 @@
1042 text: cardData && cardData["subtitle"] || "";
1043 font.weight: Font.Light;
1044 }
1045-UbuntuShape {
1046- id: touchdown;
1047- objectName: "touchdown";
1048- anchors { fill: artShapeHolder }
1049- visible: root.artShapeStyle != "shadow" && root.artShapeStyle != "icon" && root.pressed;
1050- radius: "medium";
1051- borderSource: "radius_pressed.sci"
1052-}
1053 implicitHeight: subtitleLabel.y + subtitleLabel.height + units.gu(1);
1054 }
1055
1056=== modified file 'tests/plugins/Dash/cardcreator/3.res.cardcreator'
1057--- tests/plugins/Dash/cardcreator/3.res.cardcreator 2016-05-04 14:09:00 +0000
1058+++ tests/plugins/Dash/cardcreator/3.res.cardcreator 2016-05-23 08:06:08 +0000
1059@@ -1,7 +1,6 @@
1060 AbstractButton {
1061 id: root;
1062 property var cardData;
1063- property string artShapeStyle: "inset";
1064 property string backgroundShapeStyle: "inset";
1065 property real fontScale: 1.0;
1066 property var scopeStyle: null;
1067@@ -21,6 +20,7 @@
1068 id: artShapeLoader;
1069 objectName: "artShapeLoader";
1070 readonly property string cardArt: cardData && cardData["art"] || "";
1071+ onCardArtChanged: { if (item) { item.image.source = cardArt; } }
1072 active: cardArt != "";
1073 asynchronous: false;
1074 visible: status == Loader.Ready;
1075@@ -29,30 +29,10 @@
1076 objectName: "artShape";
1077 visible: image.status == Image.Ready;
1078 readonly property alias image: artImage;
1079- Loader {
1080+ ProportionalShape {
1081 anchors.fill: parent;
1082- visible: true;
1083- sourceComponent: root.artShapeStyle === "icon" ? artShapeIconComponent : artShapeShapeComponent;
1084- Component {
1085- id: artShapeShapeComponent;
1086- UbuntuShape {
1087- source: artImage;
1088- sourceFillMode: UbuntuShape.PreserveAspectCrop;
1089- radius: "medium";
1090- aspect: {
1091- switch (root.artShapeStyle) {
1092- case "inset": return UbuntuShape.Inset;
1093- case "shadow": return UbuntuShape.DropShadow;
1094- default:
1095- case "flat": return UbuntuShape.Flat;
1096- }
1097- }
1098- }
1099- }
1100- Component {
1101- id: artShapeIconComponent;
1102- ProportionalShape { source: artImage; aspect: UbuntuShape.DropShadow; }
1103- }
1104+ source: artImage;
1105+ aspect: UbuntuShape.DropShadow;
1106 }
1107 readonly property real fixedArtShapeSizeAspect: (root.fixedArtShapeSize.height > 0 && root.fixedArtShapeSize.width > 0) ? root.fixedArtShapeSize.width / root.fixedArtShapeSize.height : -1;
1108 readonly property real aspect: fixedArtShapeSizeAspect > 0 ? fixedArtShapeSizeAspect : 0.75;
1109@@ -72,7 +52,7 @@
1110 objectName: "artImage";
1111 source: artShapeLoader.cardArt;
1112 asynchronous: false;
1113- visible: !true;
1114+ visible: false;
1115 width: root.width;
1116 height: width / artShape.aspect;
1117 }
1118@@ -118,13 +98,5 @@
1119 text: cardData && cardData["subtitle"] || "";
1120 font.weight: Font.Light;
1121 }
1122-UbuntuShape {
1123- id: touchdown;
1124- objectName: "touchdown";
1125- anchors { fill: artShapeHolder }
1126- visible: root.artShapeStyle != "shadow" && root.artShapeStyle != "icon" && root.pressed;
1127- radius: "medium";
1128- borderSource: "radius_pressed.sci"
1129-}
1130 implicitHeight: subtitleLabel.y + subtitleLabel.height + units.gu(1);
1131 }
1132
1133=== modified file 'tests/plugins/Dash/cardcreator/3.tst'
1134--- tests/plugins/Dash/cardcreator/3.tst 2016-01-21 22:44:41 +0000
1135+++ tests/plugins/Dash/cardcreator/3.tst 2016-05-23 08:06:08 +0000
1136@@ -1,3 +1,4 @@
1137 template: {"card-layout":"vertical","card-size":"small","category-layout":"grid","collapsed-rows":2}
1138 components: {"art":{"aspect-ratio":0.75,"field":"art","fallback":"IHAVE\\\"ESCAPED\\\"QUOTES\\\""},"subtitle":{"field":"price"},"title":{"field":"title"},"attributes":{}}
1139+artShapeStyle: icon
1140 result: 3.res
1141
1142=== modified file 'tests/plugins/Dash/cardcreator/4.res'
1143--- tests/plugins/Dash/cardcreator/4.res 2016-03-07 12:39:23 +0000
1144+++ tests/plugins/Dash/cardcreator/4.res 2016-05-23 08:06:08 +0000
1145@@ -1,7 +1,6 @@
1146 AbstractButton {
1147 id: root;
1148 property var cardData;
1149- property string artShapeStyle: "inset";
1150 property string backgroundShapeStyle: "inset";
1151 property real fontScale: 1.0;
1152 property var scopeStyle: null;
1153@@ -103,7 +102,7 @@
1154 id: touchdown;
1155 objectName: "touchdown";
1156 anchors { fill: root }
1157- visible: root.artShapeStyle != "shadow" && root.artShapeStyle != "icon" && root.pressed;
1158+ visible: root.pressed;
1159 radius: "medium";
1160 borderSource: "radius_pressed.sci"
1161 }
1162
1163=== modified file 'tests/plugins/Dash/cardcreator/4.res.cardcreator'
1164--- tests/plugins/Dash/cardcreator/4.res.cardcreator 2016-03-07 12:39:23 +0000
1165+++ tests/plugins/Dash/cardcreator/4.res.cardcreator 2016-05-23 08:06:08 +0000
1166@@ -1,7 +1,6 @@
1167 AbstractButton {
1168 id: root;
1169 property var cardData;
1170- property string artShapeStyle: "inset";
1171 property string backgroundShapeStyle: "inset";
1172 property real fontScale: 1.0;
1173 property var scopeStyle: null;
1174@@ -101,7 +100,7 @@
1175 id: touchdown;
1176 objectName: "touchdown";
1177 anchors { fill: root }
1178- visible: root.artShapeStyle != "shadow" && root.artShapeStyle != "icon" && root.pressed;
1179+ visible: root.pressed;
1180 radius: "medium";
1181 borderSource: "radius_pressed.sci"
1182 }
1183
1184=== modified file 'tests/plugins/Dash/cardcreator/4.tst'
1185--- tests/plugins/Dash/cardcreator/4.tst 2014-08-08 08:54:12 +0000
1186+++ tests/plugins/Dash/cardcreator/4.tst 2016-05-23 08:06:08 +0000
1187@@ -1,3 +1,4 @@
1188 template: {"card-layout":"horizontal","card-size":"large","category-layout":"grid","collapsed-rows":2}
1189 components: {"art":{"aspect-ratio":1},"mascot":{"field":"mascot"},"subtitle":{"field":"domain"},"title":{"field":"title"},"attributes":{}}
1190+artShapeStyle: flat
1191 result: 4.res
1192
1193=== modified file 'tests/plugins/Dash/cardcreator/5.res'
1194--- tests/plugins/Dash/cardcreator/5.res 2016-05-04 14:09:00 +0000
1195+++ tests/plugins/Dash/cardcreator/5.res 2016-05-23 08:06:08 +0000
1196@@ -1,7 +1,6 @@
1197 AbstractButton {
1198 id: root;
1199 property var cardData;
1200- property string artShapeStyle: "inset";
1201 property string backgroundShapeStyle: "inset";
1202 property real fontScale: 1.0;
1203 property var scopeStyle: null;
1204@@ -22,6 +21,7 @@
1205 id: artShapeLoader;
1206 objectName: "artShapeLoader";
1207 readonly property string cardArt: cardData && cardData["art"] || "";
1208+ onCardArtChanged: { if (item) { item.image.source = cardArt; } }
1209 active: cardArt != "";
1210 asynchronous: true;
1211 visible: status == Loader.Ready;
1212@@ -30,31 +30,6 @@
1213 objectName: "artShape";
1214 visible: image.status == Image.Ready;
1215 readonly property alias image: artImage;
1216- Loader {
1217- anchors.fill: parent;
1218- visible: false;
1219- sourceComponent: root.artShapeStyle === "icon" ? artShapeIconComponent : artShapeShapeComponent;
1220- Component {
1221- id: artShapeShapeComponent;
1222- UbuntuShape {
1223- source: artImage;
1224- sourceFillMode: UbuntuShape.PreserveAspectCrop;
1225- radius: "medium";
1226- aspect: {
1227- switch (root.artShapeStyle) {
1228- case "inset": return UbuntuShape.Inset;
1229- case "shadow": return UbuntuShape.DropShadow;
1230- default:
1231- case "flat": return UbuntuShape.Flat;
1232- }
1233- }
1234- }
1235- }
1236- Component {
1237- id: artShapeIconComponent;
1238- ProportionalShape { source: artImage; aspect: UbuntuShape.DropShadow; }
1239- }
1240- }
1241 readonly property real fixedArtShapeSizeAspect: (root.fixedArtShapeSize.height > 0 && root.fixedArtShapeSize.width > 0) ? root.fixedArtShapeSize.width / root.fixedArtShapeSize.height : -1;
1242 readonly property real aspect: fixedArtShapeSizeAspect > 0 ? fixedArtShapeSizeAspect : 1;
1243 Component.onCompleted: { updateWidthHeightBindings(); }
1244@@ -73,7 +48,7 @@
1245 objectName: "artImage";
1246 source: artShapeLoader.cardArt;
1247 asynchronous: true;
1248- visible: !false;
1249+ visible: true;
1250 width: root.width;
1251 height: width / artShape.aspect;
1252 }
1253@@ -138,13 +113,5 @@
1254 text: cardData && cardData["subtitle"] || "";
1255 font.weight: Font.Light;
1256 }
1257-UbuntuShape {
1258- id: touchdown;
1259- objectName: "touchdown";
1260- anchors { fill: artShapeHolder }
1261- visible: root.artShapeStyle != "shadow" && root.artShapeStyle != "icon" && root.pressed;
1262- radius: "medium";
1263- borderSource: "radius_pressed.sci"
1264-}
1265 implicitHeight: artShapeHolder.height;
1266 }
1267
1268=== modified file 'tests/plugins/Dash/cardcreator/5.res.cardcreator'
1269--- tests/plugins/Dash/cardcreator/5.res.cardcreator 2016-05-04 14:09:00 +0000
1270+++ tests/plugins/Dash/cardcreator/5.res.cardcreator 2016-05-23 08:06:08 +0000
1271@@ -1,7 +1,6 @@
1272 AbstractButton {
1273 id: root;
1274 property var cardData;
1275- property string artShapeStyle: "inset";
1276 property string backgroundShapeStyle: "inset";
1277 property real fontScale: 1.0;
1278 property var scopeStyle: null;
1279@@ -21,6 +20,7 @@
1280 id: artShapeLoader;
1281 objectName: "artShapeLoader";
1282 readonly property string cardArt: cardData && cardData["art"] || "";
1283+ onCardArtChanged: { if (item) { item.image.source = cardArt; } }
1284 active: cardArt != "";
1285 asynchronous: false;
1286 visible: status == Loader.Ready;
1287@@ -29,31 +29,6 @@
1288 objectName: "artShape";
1289 visible: image.status == Image.Ready;
1290 readonly property alias image: artImage;
1291- Loader {
1292- anchors.fill: parent;
1293- visible: false;
1294- sourceComponent: root.artShapeStyle === "icon" ? artShapeIconComponent : artShapeShapeComponent;
1295- Component {
1296- id: artShapeShapeComponent;
1297- UbuntuShape {
1298- source: artImage;
1299- sourceFillMode: UbuntuShape.PreserveAspectCrop;
1300- radius: "medium";
1301- aspect: {
1302- switch (root.artShapeStyle) {
1303- case "inset": return UbuntuShape.Inset;
1304- case "shadow": return UbuntuShape.DropShadow;
1305- default:
1306- case "flat": return UbuntuShape.Flat;
1307- }
1308- }
1309- }
1310- }
1311- Component {
1312- id: artShapeIconComponent;
1313- ProportionalShape { source: artImage; aspect: UbuntuShape.DropShadow; }
1314- }
1315- }
1316 readonly property real fixedArtShapeSizeAspect: (root.fixedArtShapeSize.height > 0 && root.fixedArtShapeSize.width > 0) ? root.fixedArtShapeSize.width / root.fixedArtShapeSize.height : -1;
1317 readonly property real aspect: fixedArtShapeSizeAspect > 0 ? fixedArtShapeSizeAspect : 1;
1318 Component.onCompleted: { updateWidthHeightBindings(); }
1319@@ -72,7 +47,7 @@
1320 objectName: "artImage";
1321 source: artShapeLoader.cardArt;
1322 asynchronous: false;
1323- visible: !false;
1324+ visible: true;
1325 width: root.width;
1326 height: width / artShape.aspect;
1327 }
1328@@ -137,13 +112,5 @@
1329 text: cardData && cardData["subtitle"] || "";
1330 font.weight: Font.Light;
1331 }
1332-UbuntuShape {
1333- id: touchdown;
1334- objectName: "touchdown";
1335- anchors { fill: artShapeHolder }
1336- visible: root.artShapeStyle != "shadow" && root.artShapeStyle != "icon" && root.pressed;
1337- radius: "medium";
1338- borderSource: "radius_pressed.sci"
1339-}
1340 implicitHeight: artShapeHolder.height;
1341 }
1342
1343=== modified file 'tests/plugins/Dash/cardcreator/5.tst'
1344--- tests/plugins/Dash/cardcreator/5.tst 2016-01-28 14:11:14 +0000
1345+++ tests/plugins/Dash/cardcreator/5.tst 2016-05-23 08:06:08 +0000
1346@@ -1,3 +1,4 @@
1347 template: {"non-interactive":true,"card-layout":"vertical","card-size":"medium","category-layout":"carousel","collapsed-rows":2,"overlay":true}
1348 components: {"art":{"aspect-ratio":1,"field":"art","conciergeMode":true},"subtitle":{"field":"artist"},"title":{"field":"title"},"attributes":{}}
1349+artShapeStyle: shadow
1350 result: 5.res
1351
1352=== modified file 'tests/plugins/Dash/cardcreator/6.res'
1353--- tests/plugins/Dash/cardcreator/6.res 2016-03-07 12:39:23 +0000
1354+++ tests/plugins/Dash/cardcreator/6.res 2016-05-23 08:06:08 +0000
1355@@ -1,7 +1,6 @@
1356 AbstractButton {
1357 id: root;
1358 property var cardData;
1359- property string artShapeStyle: "inset";
1360 property string backgroundShapeStyle: "inset";
1361 property real fontScale: 1.0;
1362 property var scopeStyle: null;
1363@@ -119,7 +118,7 @@
1364 id: touchdown;
1365 objectName: "touchdown";
1366 anchors { fill: backgroundLoader }
1367- visible: root.artShapeStyle != "shadow" && root.artShapeStyle != "icon" && root.pressed;
1368+ visible: root.pressed;
1369 radius: "medium";
1370 borderSource: "radius_pressed.sci"
1371 }
1372
1373=== modified file 'tests/plugins/Dash/cardcreator/6.res.cardcreator'
1374--- tests/plugins/Dash/cardcreator/6.res.cardcreator 2016-03-07 12:39:23 +0000
1375+++ tests/plugins/Dash/cardcreator/6.res.cardcreator 2016-05-23 08:06:08 +0000
1376@@ -1,7 +1,6 @@
1377 AbstractButton {
1378 id: root;
1379 property var cardData;
1380- property string artShapeStyle: "inset";
1381 property string backgroundShapeStyle: "inset";
1382 property real fontScale: 1.0;
1383 property var scopeStyle: null;
1384@@ -118,7 +117,7 @@
1385 id: touchdown;
1386 objectName: "touchdown";
1387 anchors { fill: backgroundLoader }
1388- visible: root.artShapeStyle != "shadow" && root.artShapeStyle != "icon" && root.pressed;
1389+ visible: root.pressed;
1390 radius: "medium";
1391 borderSource: "radius_pressed.sci"
1392 }
1393
1394=== modified file 'tests/plugins/Dash/cardcreator/6.tst'
1395--- tests/plugins/Dash/cardcreator/6.tst 2015-05-13 10:21:18 +0000
1396+++ tests/plugins/Dash/cardcreator/6.tst 2016-05-23 08:06:08 +0000
1397@@ -1,3 +1,4 @@
1398 template: {"card-background":"http://assets.ubuntu.com/sites/ubuntu/latest/u/img/logos/logo-ubuntu-grey.png","card-layout":"vertical","card-size":"medium","category-layout":"grid","collapsed-rows":2}
1399 components: {"art":{"aspect-ratio":1},"background":{"field":"background"},"subtitle":{"field":"author"},"title":{"field":"title"},"emblem":{"field":"source"},"attributes":{}}
1400+artShapeStyle: inset
1401 result: 6.res
1402
1403=== modified file 'tests/plugins/Dash/cardcreator/7.res'
1404--- tests/plugins/Dash/cardcreator/7.res 2016-03-07 12:39:23 +0000
1405+++ tests/plugins/Dash/cardcreator/7.res 2016-05-23 08:06:08 +0000
1406@@ -1,7 +1,6 @@
1407 AbstractButton {
1408 id: root;
1409 property var cardData;
1410- property string artShapeStyle: "inset";
1411 property string backgroundShapeStyle: "inset";
1412 property real fontScale: 1.0;
1413 property var scopeStyle: null;
1414@@ -139,13 +138,5 @@
1415
1416 ]
1417 }
1418-UbuntuShape {
1419- id: touchdown;
1420- objectName: "touchdown";
1421- anchors { fill: backgroundLoader }
1422- visible: root.artShapeStyle != "shadow" && root.artShapeStyle != "icon" && root.pressed;
1423- radius: "medium";
1424- borderSource: "radius_pressed.sci"
1425-}
1426 implicitHeight: row.y + row.height + units.gu(1);
1427 }
1428
1429=== modified file 'tests/plugins/Dash/cardcreator/7.res.cardcreator'
1430--- tests/plugins/Dash/cardcreator/7.res.cardcreator 2016-03-07 12:39:23 +0000
1431+++ tests/plugins/Dash/cardcreator/7.res.cardcreator 2016-05-23 08:06:08 +0000
1432@@ -1,7 +1,6 @@
1433 AbstractButton {
1434 id: root;
1435 property var cardData;
1436- property string artShapeStyle: "inset";
1437 property string backgroundShapeStyle: "inset";
1438 property real fontScale: 1.0;
1439 property var scopeStyle: null;
1440@@ -137,13 +136,5 @@
1441
1442 ]
1443 }
1444-UbuntuShape {
1445- id: touchdown;
1446- objectName: "touchdown";
1447- anchors { fill: backgroundLoader }
1448- visible: root.artShapeStyle != "shadow" && root.artShapeStyle != "icon" && root.pressed;
1449- radius: "medium";
1450- borderSource: "radius_pressed.sci"
1451-}
1452 implicitHeight: row.y + row.height + units.gu(1);
1453 }
1454
1455=== modified file 'tests/plugins/Dash/cardcreator/7.tst'
1456--- tests/plugins/Dash/cardcreator/7.tst 2015-05-13 10:21:18 +0000
1457+++ tests/plugins/Dash/cardcreator/7.tst 2016-05-23 08:06:08 +0000
1458@@ -1,3 +1,4 @@
1459 template: {"card-background":{"elements":["#E9E9E9","#E9AAE9"],"type":"color"},"card-layout":"vertical","card-size":"medium","category-layout":"grid","collapsed-rows":2}
1460 components: {"art":{"aspect-ratio":1},"background":{"field":"background"},"mascot":{"field":"icon"},"subtitle":{"field":"author"},"title":{"field":"title"},"attributes":{"field":"attributes","max-count":2}}
1461+artShapeStyle: icon
1462 result: 7.res
1463
1464=== modified file 'tests/plugins/Dash/cardcreator/8.res'
1465--- tests/plugins/Dash/cardcreator/8.res 2016-03-07 12:39:23 +0000
1466+++ tests/plugins/Dash/cardcreator/8.res 2016-05-23 08:06:08 +0000
1467@@ -1,7 +1,6 @@
1468 AbstractButton {
1469 id: root;
1470 property var cardData;
1471- property string artShapeStyle: "inset";
1472 property string backgroundShapeStyle: "inset";
1473 property real fontScale: 1.0;
1474 property var scopeStyle: null;
1475@@ -101,7 +100,7 @@
1476 id: touchdown;
1477 objectName: "touchdown";
1478 anchors { fill: backgroundLoader }
1479- visible: root.artShapeStyle != "shadow" && root.artShapeStyle != "icon" && root.pressed;
1480+ visible: root.pressed;
1481 radius: "medium";
1482 borderSource: "radius_pressed.sci"
1483 }
1484
1485=== modified file 'tests/plugins/Dash/cardcreator/8.res.cardcreator'
1486--- tests/plugins/Dash/cardcreator/8.res.cardcreator 2016-03-07 12:39:23 +0000
1487+++ tests/plugins/Dash/cardcreator/8.res.cardcreator 2016-05-23 08:06:08 +0000
1488@@ -1,7 +1,6 @@
1489 AbstractButton {
1490 id: root;
1491 property var cardData;
1492- property string artShapeStyle: "inset";
1493 property string backgroundShapeStyle: "inset";
1494 property real fontScale: 1.0;
1495 property var scopeStyle: null;
1496@@ -99,7 +98,7 @@
1497 id: touchdown;
1498 objectName: "touchdown";
1499 anchors { fill: backgroundLoader }
1500- visible: root.artShapeStyle != "shadow" && root.artShapeStyle != "icon" && root.pressed;
1501+ visible: root.pressed;
1502 radius: "medium";
1503 borderSource: "radius_pressed.sci"
1504 }
1505
1506=== modified file 'tests/plugins/Dash/cardcreator/8.tst'
1507--- tests/plugins/Dash/cardcreator/8.tst 2015-06-22 08:29:55 +0000
1508+++ tests/plugins/Dash/cardcreator/8.tst 2016-05-23 08:06:08 +0000
1509@@ -1,3 +1,4 @@
1510 template: {"card-background":{"elements":["#E9E9E9","#E9AAE9"],"type":"color"},"card-layout":"vertical","card-size":"medium","category-layout":"grid","collapsed-rows":2}
1511 components: {"background":{"field":"background"},"mascot":{"field":"icon"},"title":{"field":"title"},"attributes":{}}
1512+artShapeStyle: inset
1513 result: 8.res
1514
1515=== modified file 'tests/plugins/Dash/cardcreator/9.res'
1516--- tests/plugins/Dash/cardcreator/9.res 2016-03-14 17:00:28 +0000
1517+++ tests/plugins/Dash/cardcreator/9.res 2016-05-23 08:06:08 +0000
1518@@ -1,7 +1,6 @@
1519 AbstractButton {
1520 id: root;
1521 property var cardData;
1522- property string artShapeStyle: "inset";
1523 property string backgroundShapeStyle: "inset";
1524 property real fontScale: 1.0;
1525 property var scopeStyle: null;
1526@@ -112,7 +111,7 @@
1527 id: touchdown;
1528 objectName: "touchdown";
1529 anchors { fill: root }
1530- visible: root.artShapeStyle != "shadow" && root.artShapeStyle != "icon" && root.pressed;
1531+ visible: root.pressed;
1532 radius: "medium";
1533 borderSource: "radius_pressed.sci"
1534 }
1535
1536=== modified file 'tests/plugins/Dash/cardcreator/9.res.cardcreator'
1537--- tests/plugins/Dash/cardcreator/9.res.cardcreator 2016-03-21 16:06:10 +0000
1538+++ tests/plugins/Dash/cardcreator/9.res.cardcreator 2016-05-23 08:06:08 +0000
1539@@ -1,7 +1,6 @@
1540 AbstractButton {
1541 id: root;
1542 property var cardData;
1543- property string artShapeStyle: "inset";
1544 property string backgroundShapeStyle: "inset";
1545 property real fontScale: 1.0;
1546 property var scopeStyle: null;
1547@@ -111,7 +110,7 @@
1548 id: touchdown;
1549 objectName: "touchdown";
1550 anchors { fill: root }
1551- visible: root.artShapeStyle != "shadow" && root.artShapeStyle != "icon" && root.pressed;
1552+ visible: root.pressed;
1553 radius: "medium";
1554 borderSource: "radius_pressed.sci"
1555 }
1556
1557=== modified file 'tests/plugins/Dash/cardcreator/9.tst'
1558--- tests/plugins/Dash/cardcreator/9.tst 2015-07-06 07:52:35 +0000
1559+++ tests/plugins/Dash/cardcreator/9.tst 2016-05-23 08:06:08 +0000
1560@@ -1,3 +1,4 @@
1561 template: {"card-layout":"horizontal","card-size":"medium","category-layout":"grid","collapsed-rows":2,"quick-preview-type": "audio"}
1562 components: {"art":{"aspect-ratio":1},"subtitle":{"field":"author"},"title":{"field":"title"}, "quickPreviewData": "quickPreviewData"}
1563+artShapeStyle: inset
1564 result: 9.res
1565
1566=== modified file 'tests/plugins/Dash/cardcreatortest.cpp'
1567--- tests/plugins/Dash/cardcreatortest.cpp 2016-02-16 13:34:54 +0000
1568+++ tests/plugins/Dash/cardcreatortest.cpp 2016-05-23 08:06:08 +0000
1569@@ -73,6 +73,7 @@
1570 {
1571 const QString templateString("template: ");
1572 const QString componentsString("components: ");
1573+ const QString artShapeStyleString("artShapeStyle: ");
1574 const QString resultString("result: ");
1575
1576 const QString testDirPath = DASHVIEWSTEST_FOLDER "/cardcreator/";
1577@@ -87,24 +88,26 @@
1578
1579 QVERIFY(lines[0].startsWith(templateString));
1580 QVERIFY(lines[1].startsWith(componentsString));
1581- QVERIFY(lines[2].startsWith(resultString));
1582+ QVERIFY(lines[2].startsWith(artShapeStyleString));
1583+ QVERIFY(lines[3].startsWith(resultString));
1584
1585 const QString templateJSON = lines[0].mid(templateString.length());
1586 const QString componentsJSON = lines[1].mid(componentsString.length());
1587- const QString resultFileName = lines[2].mid(resultString.length());
1588+ const QString artShapeStyle = lines[2].mid(artShapeStyleString.length());
1589+ const QString resultFileName = lines[3].mid(resultString.length());
1590 QVariant cardStringResult;
1591 QVariant createCardComponentResult;
1592
1593- QMetaObject::invokeMethod(view->rootObject(), "cardString", Q_RETURN_ARG(QVariant, cardStringResult), Q_ARG(QVariant, templateJSON), Q_ARG(QVariant, componentsJSON), Q_ARG(QVariant, false));
1594+ QMetaObject::invokeMethod(view->rootObject(), "cardString", Q_RETURN_ARG(QVariant, cardStringResult), Q_ARG(QVariant, templateJSON), Q_ARG(QVariant, componentsJSON), Q_ARG(QVariant, false), Q_ARG(QVariant, artShapeStyle));
1595 compareFileContents(testDirPath + resultFileName, cardStringResult.toString());
1596
1597- QMetaObject::invokeMethod(view->rootObject(), "cardString", Q_RETURN_ARG(QVariant, cardStringResult), Q_ARG(QVariant, templateJSON), Q_ARG(QVariant, componentsJSON), Q_ARG(QVariant, true));
1598+ QMetaObject::invokeMethod(view->rootObject(), "cardString", Q_RETURN_ARG(QVariant, cardStringResult), Q_ARG(QVariant, templateJSON), Q_ARG(QVariant, componentsJSON), Q_ARG(QVariant, true), Q_ARG(QVariant, artShapeStyle));
1599 compareFileContents(testDirPath + resultFileName + ".cardcreator", cardStringResult.toString());
1600
1601- QMetaObject::invokeMethod(view->rootObject(), "createCardComponent", Q_RETURN_ARG(QVariant, createCardComponentResult), Q_ARG(QVariant, templateJSON), Q_ARG(QVariant, componentsJSON), Q_ARG(QVariant, false));
1602+ QMetaObject::invokeMethod(view->rootObject(), "createCardComponent", Q_RETURN_ARG(QVariant, createCardComponentResult), Q_ARG(QVariant, templateJSON), Q_ARG(QVariant, componentsJSON), Q_ARG(QVariant, false), Q_ARG(QVariant, artShapeStyle));
1603 QVERIFY(createCardComponentResult.toBool());
1604
1605- QMetaObject::invokeMethod(view->rootObject(), "createCardComponent", Q_RETURN_ARG(QVariant, createCardComponentResult), Q_ARG(QVariant, templateJSON), Q_ARG(QVariant, componentsJSON), Q_ARG(QVariant, true));
1606+ QMetaObject::invokeMethod(view->rootObject(), "createCardComponent", Q_RETURN_ARG(QVariant, createCardComponentResult), Q_ARG(QVariant, templateJSON), Q_ARG(QVariant, componentsJSON), Q_ARG(QVariant, true), Q_ARG(QVariant, artShapeStyle));
1607 QVERIFY(createCardComponentResult.toBool());
1608 }
1609 }
1610
1611=== modified file 'tests/plugins/Dash/cardcreatortest.qml'
1612--- tests/plugins/Dash/cardcreatortest.qml 2016-02-16 13:34:54 +0000
1613+++ tests/plugins/Dash/cardcreatortest.qml 2016-05-23 08:06:08 +0000
1614@@ -19,11 +19,11 @@
1615
1616 Item {
1617 id: root
1618- function cardString(template, components, isCardCreator) {
1619- return CardCreator.cardString(JSON.parse(template), JSON.parse(components), isCardCreator);
1620+ function cardString(template, components, isCardCreator, artShapeStyle) {
1621+ return CardCreator.cardString(JSON.parse(template), JSON.parse(components), isCardCreator, artShapeStyle);
1622 }
1623
1624- function createCardComponent(template, components, isCardCreator) {
1625- return CardCreator.createCardComponent(root, JSON.parse(template), JSON.parse(components), isCardCreator) !== null;
1626+ function createCardComponent(template, components, isCardCreator, artShapeStyle) {
1627+ return CardCreator.createCardComponent(root, JSON.parse(template), JSON.parse(components), isCardCreator, artShapeStyle) !== null;
1628 }
1629 }
1630
1631=== modified file 'tests/qmltests/Dash/tst_Card.qml'
1632--- tests/qmltests/Dash/tst_Card.qml 2016-05-04 14:09:00 +0000
1633+++ tests/qmltests/Dash/tst_Card.qml 2016-05-23 08:06:08 +0000
1634@@ -496,6 +496,18 @@
1635 tryCompare(art, "visible", true);
1636 compare(artImage.source, Qt.resolvedUrl("artwork/checkers.png"));
1637
1638+ card.cardData["art"] = "somethingbroken";
1639+ card.cardDataChanged();
1640+ waitForRendering(card);
1641+ tryCompare(art, "visible", true);
1642+ compare(artImage.source, Qt.resolvedUrl("artwork/checkers.png"));
1643+
1644+ card.cardData["art"] = Qt.resolvedUrl("artwork/music-player-design.png");
1645+ card.cardDataChanged();
1646+ waitForRendering(card);
1647+ tryCompare(art, "visible", true);
1648+ compare(artImage.source, Qt.resolvedUrl("artwork/music-player-design.png"));
1649+
1650 card.cardData["mascot"] = "somethingbroken2";
1651 card.cardDataChanged();
1652 compare(mascotImage.status, Image.Error);

Subscribers

People subscribed via source and target branches