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

Proposed by Albert Astals Cid on 2016-03-04
Status: Merged
Approved by: Andrea Cimitan on 2016-03-18
Approved revision: 2213
Merged at revision: 2412
Proposed branch: lp:~aacid/unity8/cardArtShapeStyleOnCompileTime
Merge into: lp:unity8
Prerequisite: lp:~aacid/unity8/appStoreCardWeirdSizing
Diff against target: 1502 lines (+176/-422)
44 files modified
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 (+7/-25)
tests/plugins/Dash/cardcreator/1.res.cardcreator (+7/-25)
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 (+10/-28)
tests/plugins/Dash/cardcreator/11.res.cardcreator (+9/-27)
tests/plugins/Dash/cardcreator/11.tst (+1/-0)
tests/plugins/Dash/cardcreator/12.res (+7/-25)
tests/plugins/Dash/cardcreator/12.res.cardcreator (+9/-27)
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 (+4/-32)
tests/plugins/Dash/cardcreator/3.res.cardcreator (+4/-32)
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 (+6/-32)
tests/plugins/Dash/cardcreator/5.res.cardcreator (+6/-32)
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)
To merge this branch: bzr merge lp:~aacid/unity8/cardArtShapeStyleOnCompileTime
Reviewer Review Type Date Requested Status
Unity8 CI Bot continuous-integration Needs Fixing on 2016-03-24
Andrea Cimitan (community) 2016-03-04 Approve on 2016-03-17
Review via email: mp+288103@code.launchpad.net

Commit Message

Resolve cardArtStyle on compile time

Allow us to not create Components and Shapes that we're not going to use

Description of the Change

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

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

 * Did you make sure that your branch does not contain spurious tags?
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.
Unity8 CI Bot (unity8-ci-bot) wrote :

FAILED: Continuous integration, rev:2212
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/601/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=vivid+overlay,testname=qmluitests.sh/335
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial,testname=qmluitests.sh/335
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=phone-armhf,release=vivid+overlay,testname=autopilot.sh/335
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/792
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/807
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial/807
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/806
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/806/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial/806
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial/806/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/806
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/806/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial/806
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial/806/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/806
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/806/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial/806
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial/806/artifact/output/*zip*/output.zip

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

review: Needs Fixing (continuous-integration)
2213. By Albert Astals Cid on 2016-03-14

Merge

Andrea Cimitan (cimi) wrote :

 * Did you perform an exploratory manual test run of the code change and any related functionality?will test it thoroughly with other branches depending on this
 * Did CI run pass? If not, please explain why.
deps
 * Did you make sure that the branch does not contain spurious tags?
yes

review: Approve
Unity8 CI Bot (unity8-ci-bot) wrote :

FAILED: Continuous integration, rev:2213
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/829/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/1076
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/1094
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial/1094
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/1092
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/1092/artifact/output/*zip*/output.zip
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial/1092/console
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/1092
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/1092/artifact/output/*zip*/output.zip
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial/1092/console
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/1092
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/1092/artifact/output/*zip*/output.zip
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial/1092/console

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

review: Needs Fixing (continuous-integration)
2214. By Albert Astals Cid on 2016-05-09

Merge

Preview Diff

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

Subscribers

People subscribed via source and target branches