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