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

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
Reviewer Review Type Date Requested Status
Unity Team Pending
Review via email: mp+289484@code.launchpad.net

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.
lp:~aacid/unity8/recoverArtIfChanges updated
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
=== modified file 'plugins/Dash/CardCreator.js'
--- plugins/Dash/CardCreator.js 2016-03-10 16:53:04 +0000
+++ plugins/Dash/CardCreator.js 2016-03-18 11:31:31 +0000
@@ -59,14 +59,30 @@
59 } \n\59 } \n\
60 }\n';60 }\n';
6161
62// %1 is the aspect of the UbuntuShape
63var kArtUbuntuShapeCode = 'UbuntuShape { \n\
64 anchors.fill: parent; \n\
65 source: artImage; \n\
66 sourceFillMode: UbuntuShape.PreserveAspectCrop; \n\
67 radius: "medium"; \n\
68 aspect: %1; \n\
69 }';
70
71var kArtProportionalShapeCode = 'ProportionalShape { \n\
72 anchors.fill: parent; \n\
73 source: artImage; \n\
74 aspect: UbuntuShape.DropShadow; \n\
75 }';
76
62// %1 is used as anchors of artShapeHolder77// %1 is used as anchors of artShapeHolder
63// %2 is used as image width78// %2 is used as image width
64// %3 is used as image height79// %3 is used as image height
65// %4 is used for artShapeSource.hideSource and inner Loader visible80// %4 is whether the image should be visible
66// %5 is used as aspect ratio fallback81// %5 is used as aspect ratio fallback
67// %6 is whether the loader should be asynchronous or not82// %6 is whether the loader should be asynchronous or not
68// %7 is injected as code to artImage83// %7 is the shape code we want to use
69// %8 is used as image fallback84// %8 is injected as code to artImage
85// %9 is used as image fallback
70var kArtShapeHolderCode = 'Item { \n\86var kArtShapeHolderCode = 'Item { \n\
71 id: artShapeHolder; \n\87 id: artShapeHolder; \n\
72 height: root.fixedArtShapeSize.height > 0 ? root.fixedArtShapeSize.height : artShapeLoader.height; \n\88 height: root.fixedArtShapeSize.height > 0 ? root.fixedArtShapeSize.height : artShapeLoader.height; \n\
@@ -75,7 +91,8 @@
75 Loader { \n\91 Loader { \n\
76 id: artShapeLoader; \n\92 id: artShapeLoader; \n\
77 objectName: "artShapeLoader"; \n\93 objectName: "artShapeLoader"; \n\
78 readonly property string cardArt: cardData && cardData["art"] || %8; \n\94 readonly property string cardArt: cardData && cardData["art"] || %9; \n\
95 onCardArtChanged: { if (item) { item.image.source = cardArt; } } \n\
79 active: cardArt != ""; \n\96 active: cardArt != ""; \n\
80 asynchronous: %6; \n\97 asynchronous: %6; \n\
81 visible: status == Loader.Ready; \n\98 visible: status == Loader.Ready; \n\
@@ -84,39 +101,7 @@
84 objectName: "artShape"; \n\101 objectName: "artShape"; \n\
85 visible: image.status == Image.Ready; \n\102 visible: image.status == Image.Ready; \n\
86 readonly property alias image: artImage; \n\103 readonly property alias image: artImage; \n\
87 ShaderEffectSource { \n\104 %7 \n\
88 id: artShapeSource; \n\
89 sourceItem: artImage; \n\
90 anchors.centerIn: parent; \n\
91 width: 1; \n\
92 height: 1; \n\
93 hideSource: %4; \n\
94 } \n\
95 Loader { \n\
96 anchors.fill: parent; \n\
97 visible: %4; \n\
98 sourceComponent: root.artShapeStyle === "icon" ? artShapeIconComponent : artShapeShapeComponent; \n\
99 Component { \n\
100 id: artShapeShapeComponent; \n\
101 UbuntuShape { \n\
102 source: artShapeSource; \n\
103 sourceFillMode: UbuntuShape.PreserveAspectCrop; \n\
104 radius: "medium"; \n\
105 aspect: { \n\
106 switch (root.artShapeStyle) { \n\
107 case "inset": return UbuntuShape.Inset; \n\
108 case "shadow": return UbuntuShape.DropShadow; \n\
109 default: \n\
110 case "flat": return UbuntuShape.Flat; \n\
111 } \n\
112 } \n\
113 } \n\
114 } \n\
115 Component { \n\
116 id: artShapeIconComponent; \n\
117 ProportionalShape { source: artShapeSource; aspect: UbuntuShape.DropShadow; } \n\
118 } \n\
119 } \n\
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\
121 readonly property real aspect: fixedArtShapeSizeAspect > 0 ? fixedArtShapeSizeAspect : %5; \n\106 readonly property real aspect: fixedArtShapeSizeAspect > 0 ? fixedArtShapeSizeAspect : %5; \n\
122 Component.onCompleted: { updateWidthHeightBindings(); } \n\107 Component.onCompleted: { updateWidthHeightBindings(); } \n\
@@ -135,9 +120,10 @@
135 objectName: "artImage"; \n\120 objectName: "artImage"; \n\
136 source: artShapeLoader.cardArt; \n\121 source: artShapeLoader.cardArt; \n\
137 asynchronous: %6; \n\122 asynchronous: %6; \n\
123 visible: %4; \n\
138 width: %2; \n\124 width: %2; \n\
139 height: %3; \n\125 height: %3; \n\
140 %7 \n\126 %8 \n\
141 } \n\127 } \n\
142 } \n\128 } \n\
143 } \n\129 } \n\
@@ -325,7 +311,7 @@
325 id: touchdown; \n\311 id: touchdown; \n\
326 objectName: "touchdown"; \n\312 objectName: "touchdown"; \n\
327 anchors { %1 } \n\313 anchors { %1 } \n\
328 visible: root.artShapeStyle != "shadow" && root.artShapeStyle != "icon" && root.pressed; \n\314 visible: root.pressed; \n\
329 radius: "medium"; \n\315 radius: "medium"; \n\
330 borderSource: "radius_pressed.sci" \n\316 borderSource: "radius_pressed.sci" \n\
331 }\n';317 }\n';
@@ -408,7 +394,7 @@
408 return colorString;394 return colorString;
409}395}
410396
411function cardString(template, components, isCardTool) {397function cardString(template, components, isCardTool, artShapeStyle) {
412 var code;398 var code;
413399
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";
@@ -416,7 +402,6 @@
416 code = 'AbstractButton { \n\402 code = 'AbstractButton { \n\
417 id: root; \n\403 id: root; \n\
418 property var cardData; \n\404 property var cardData; \n\
419 property string artShapeStyle: "inset"; \n\
420 property string backgroundShapeStyle: "inset"; \n\405 property string backgroundShapeStyle: "inset"; \n\
421 property real fontScale: 1.0; \n\406 property real fontScale: 1.0; \n\
422 property var scopeStyle: null; \n\407 property var scopeStyle: null; \n\
@@ -513,17 +498,35 @@
513 var fallbackStatusCode = "";498 var fallbackStatusCode = "";
514 var fallbackURICode = '""';499 var fallbackURICode = '""';
515 if (fallback !== "") {500 if (fallback !== "") {
516 // fallbackStatusCode has %6 in it because we want to substitute it for fallbackURICode501 // fallbackStatusCode has %9 in it because we want to substitute it for fallbackURICode
517 // which in kArtShapeHolderCode is %8502 // which in kArtShapeHolderCode is %9
518 fallbackStatusCode += 'onStatusChanged: if (status === Image.Error) source = %8;';503 fallbackStatusCode += 'onStatusChanged: if (status === Image.Error) source = %9;';
519 fallbackURICode = 'decodeURI("%1")'.arg(fallback);504 fallbackURICode = 'decodeURI("%1")'.arg(fallback);
520 }505 }
506 var artShapeHolderShapeCode;
507 if (!isConciergeMode) {
508 if (artShapeStyle === "icon") {
509 artShapeHolderShapeCode = kArtProportionalShapeCode;
510 } else {
511 var artShapeHolderShapeAspect;
512 switch (artShapeStyle) {
513 case "inset": artShapeHolderShapeAspect = "UbuntuShape.Inset"; break;
514 case "shadow": artShapeHolderShapeAspect = "UbuntuShape.DropShadow"; break;
515 default:
516 case "flat": artShapeHolderShapeAspect = "UbuntuShape.Flat"; break;
517 }
518 artShapeHolderShapeCode = kArtUbuntuShapeCode.arg(artShapeHolderShapeAspect);
519 }
520 } else {
521 artShapeHolderShapeCode = "";
522 }
521 code += kArtShapeHolderCode.arg(artAnchors)523 code += kArtShapeHolderCode.arg(artAnchors)
522 .arg(widthCode)524 .arg(widthCode)
523 .arg(heightCode)525 .arg(heightCode)
524 .arg(isConciergeMode ? "false" : "true")526 .arg(isConciergeMode ? "true" : "false")
525 .arg(aspectRatio)527 .arg(aspectRatio)
526 .arg(asynchronous)528 .arg(asynchronous)
529 .arg(artShapeHolderShapeCode)
527 .arg(fallbackStatusCode)530 .arg(fallbackStatusCode)
528 .arg(fallbackURICode);531 .arg(fallbackURICode);
529 } else {532 } else {
@@ -848,15 +851,17 @@
848 code += kSummaryLabelCode.arg(summaryTopAnchor).arg(summaryTopMargin).arg(summaryColor);851 code += kSummaryLabelCode.arg(summaryTopAnchor).arg(summaryTopMargin).arg(summaryColor);
849 }852 }
850853
851 var touchdownAnchors;854 if (artShapeStyle != "shadow" && artShapeStyle != "icon") {
852 if (hasBackground) {855 var touchdownAnchors;
853 touchdownAnchors = 'fill: backgroundLoader';856 if (hasBackground) {
854 } else if (touchdownOnArtShape) {857 touchdownAnchors = 'fill: backgroundLoader';
855 touchdownAnchors = 'fill: artShapeHolder';858 } else if (touchdownOnArtShape) {
856 } else {859 touchdownAnchors = 'fill: artShapeHolder';
857 touchdownAnchors = 'fill: root'860 } else {
861 touchdownAnchors = 'fill: root'
862 }
863 code += kTouchdownCode.arg(touchdownAnchors);
858 }864 }
859 code += kTouchdownCode.arg(touchdownAnchors);
860865
861 var implicitHeight = 'implicitHeight: ';866 var implicitHeight = 'implicitHeight: ';
862 if (hasSummary) {867 if (hasSummary) {
@@ -889,13 +894,13 @@
889 return code;894 return code;
890}895}
891896
892function createCardComponent(parent, template, components, isCardTool, identifier) {897function createCardComponent(parent, template, components, isCardTool, artShapeStyle, identifier) {
893 var imports = 'import QtQuick 2.4; \n\898 var imports = 'import QtQuick 2.4; \n\
894 import Ubuntu.Components 1.3; \n\899 import Ubuntu.Components 1.3; \n\
895 import Ubuntu.Settings.Components 0.1; \n\900 import Ubuntu.Settings.Components 0.1; \n\
896 import Dash 0.1;\n\901 import Dash 0.1;\n\
897 import Utils 0.1;\n';902 import Utils 0.1;\n';
898 var card = cardString(template, components, isCardTool);903 var card = cardString(template, components, isCardTool, artShapeStyle);
899 var code = imports + 'Component {\n' + card + '}\n';904 var code = imports + 'Component {\n' + card + '}\n';
900905
901 try {906 try {
902907
=== modified file 'plugins/Dash/CardCreatorCache.qml'
--- plugins/Dash/CardCreatorCache.qml 2016-02-16 14:26:58 +0000
+++ plugins/Dash/CardCreatorCache.qml 2016-03-18 11:31:31 +0000
@@ -23,7 +23,7 @@
2323
24 property var cache: new Object();24 property var cache: new Object();
2525
26 function getCardComponent(template, components, isCardTool) {26 function getCardComponent(template, components, isCardTool, artShapeStyle) {
27 if (template === undefined || components === undefined)27 if (template === undefined || components === undefined)
28 return undefined;28 return undefined;
2929
@@ -32,7 +32,7 @@
32 var allString = tString + cString + isCardTool;32 var allString = tString + cString + isCardTool;
33 var component = cache[allString];33 var component = cache[allString];
34 if (component === undefined) {34 if (component === undefined) {
35 component = CardCreator.createCardComponent(root, template, components, isCardTool, allString);35 component = CardCreator.createCardComponent(root, template, components, isCardTool, artShapeStyle, allString);
36 cache[allString] = component;36 cache[allString] = component;
37 }37 }
38 return component;38 return component;
3939
=== modified file 'qml/Dash/CardCarousel.qml'
--- qml/Dash/CardCarousel.qml 2016-02-16 15:09:55 +0000
+++ qml/Dash/CardCarousel.qml 2016-03-18 11:31:31 +0000
@@ -66,7 +66,6 @@
66 item.cardData = Qt.binding(function() { return model; });66 item.cardData = Qt.binding(function() { return model; });
67 item.fontScale = Qt.binding(function() { return carousel.fontScale; });67 item.fontScale = Qt.binding(function() { return carousel.fontScale; });
68 item.showHeader = Qt.binding(function() { return loader.explicitlyScaled; });68 item.showHeader = Qt.binding(function() { return loader.explicitlyScaled; });
69 item.artShapeStyle = "shadow";
70 item.scopeStyle = cardCarousel.scopeStyle;69 item.scopeStyle = cardCarousel.scopeStyle;
71 }70 }
72 }71 }
7372
=== modified file 'qml/Dash/CardGrid.qml'
--- qml/Dash/CardGrid.qml 2016-02-16 15:09:55 +0000
+++ qml/Dash/CardGrid.qml 2016-03-18 11:31:31 +0000
@@ -25,7 +25,6 @@
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;
26 return cardTool.template["collapsed-rows"];26 return cardTool.template["collapsed-rows"];
27 }27 }
28 property string artShapeStyle: "inset";
29 property string backgroundShapeStyle: "inset";28 property string backgroundShapeStyle: "inset";
30 property alias minimumHorizontalSpacing: grid.minimumHorizontalSpacing29 property alias minimumHorizontalSpacing: grid.minimumHorizontalSpacing
3130
@@ -71,7 +70,6 @@
71 item.fixedArtShapeSize = Qt.binding(function() { return cardTool.artShapeSize; });70 item.fixedArtShapeSize = Qt.binding(function() { return cardTool.artShapeSize; });
72 item.cardData = Qt.binding(function() { return model; });71 item.cardData = Qt.binding(function() { return model; });
73 item.scopeStyle = root.scopeStyle;72 item.scopeStyle = root.scopeStyle;
74 item.artShapeStyle = root.artShapeStyle;
75 item.backgroundShapeStyle = root.backgroundShapeStyle;73 item.backgroundShapeStyle = root.backgroundShapeStyle;
76 }74 }
77 Connections {75 Connections {
7876
=== modified file 'qml/Dash/CardTool.qml'
--- qml/Dash/CardTool.qml 2016-02-17 10:51:17 +0000
+++ qml/Dash/CardTool.qml 2016-03-18 11:31:31 +0000
@@ -66,7 +66,11 @@
66 return layout;66 return layout;
67 }67 }
6868
69 property var cardComponent: CardCreatorCache.getCardComponent(cardTool.template, cardTool.components, false);69
70 // Not readonly because gets overwritten from GenericScopeView in some cases
71 property string artShapeStyle: categoryLayout === "carousel" ? "shadow" : "inset"
72
73 property var cardComponent: CardCreatorCache.getCardComponent(cardTool.template, cardTool.components, false, artShapeStyle);
7074
71 // FIXME: Saviq75 // FIXME: Saviq
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.
@@ -193,7 +197,7 @@
193 "summary": "—\n—\n—\n—\n—",197 "summary": "—\n—\n—\n—\n—",
194 "attributes": attributesModel.model198 "attributes": attributesModel.model
195 }199 }
196 sourceComponent: CardCreatorCache.getCardComponent(cardTool.template, cardTool.components, true);200 sourceComponent: CardCreatorCache.getCardComponent(cardTool.template, cardTool.components, true, artShapeStyle);
197 onLoaded: {201 onLoaded: {
198 item.objectName = "cardToolCard";202 item.objectName = "cardToolCard";
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; });
200204
=== modified file 'qml/Dash/GenericScopeView.qml'
--- qml/Dash/GenericScopeView.qml 2016-03-10 22:39:17 +0000
+++ qml/Dash/GenericScopeView.qml 2016-03-18 11:31:31 +0000
@@ -342,10 +342,10 @@
342 if (scope && scope.id === "clickscope") {342 if (scope && scope.id === "clickscope") {
343 if (categoryId === "predefined" || categoryId === "local") {343 if (categoryId === "predefined" || categoryId === "local") {
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)) });
345 item.artShapeStyle = "icon";345 cardTool.artShapeStyle = "icon";
346 } else {346 } else {
347 // Should be ubuntu store icon347 // Should be ubuntu store icon
348 item.artShapeStyle = "flat";348 cardTool.artShapeStyle = "flat";
349 item.backgroundShapeStyle = "shadow";349 item.backgroundShapeStyle = "shadow";
350 }350 }
351 }351 }
352352
=== modified file 'tests/plugins/Dash/cardcreator/1.res'
--- tests/plugins/Dash/cardcreator/1.res 2016-02-17 10:51:17 +0000
+++ tests/plugins/Dash/cardcreator/1.res 2016-03-18 11:31:31 +0000
@@ -1,7 +1,6 @@
1AbstractButton { 1AbstractButton {
2 id: root; 2 id: root;
3 property var cardData; 3 property var cardData;
4 property string artShapeStyle: "inset";
5 property string backgroundShapeStyle: "inset"; 4 property string backgroundShapeStyle: "inset";
6 property real fontScale: 1.0; 5 property real fontScale: 1.0;
7 property var scopeStyle: null; 6 property var scopeStyle: null;
@@ -22,6 +21,7 @@
22 id: artShapeLoader; 21 id: artShapeLoader;
23 objectName: "artShapeLoader"; 22 objectName: "artShapeLoader";
24 readonly property string cardArt: cardData && cardData["art"] || "";23 readonly property string cardArt: cardData && cardData["art"] || "";
24 onCardArtChanged: { if (item) { item.image.source = cardArt; } }
25 active: cardArt != "";25 active: cardArt != "";
26 asynchronous: true; 26 asynchronous: true;
27 visible: status == Loader.Ready; 27 visible: status == Loader.Ready;
@@ -30,38 +30,12 @@
30 objectName: "artShape";30 objectName: "artShape";
31 visible: image.status == Image.Ready;31 visible: image.status == Image.Ready;
32 readonly property alias image: artImage;32 readonly property alias image: artImage;
33 ShaderEffectSource {33 UbuntuShape {
34 id: artShapeSource;
35 sourceItem: artImage;
36 anchors.centerIn: parent;
37 width: 1;
38 height: 1;
39 hideSource: true;
40 }
41 Loader {
42 anchors.fill: parent;34 anchors.fill: parent;
43 visible: true;35 source: artImage;
44 sourceComponent: root.artShapeStyle === "icon" ? artShapeIconComponent : artShapeShapeComponent;36 sourceFillMode: UbuntuShape.PreserveAspectCrop;
45 Component {37 radius: "medium";
46 id: artShapeShapeComponent;38 aspect: UbuntuShape.Inset;
47 UbuntuShape {
48 source: artShapeSource;
49 sourceFillMode: UbuntuShape.PreserveAspectCrop;
50 radius: "medium";
51 aspect: {
52 switch (root.artShapeStyle) {
53 case "inset": return UbuntuShape.Inset;
54 case "shadow": return UbuntuShape.DropShadow;
55 default:
56 case "flat": return UbuntuShape.Flat;
57 }
58 }
59 }
60 }
61 Component {
62 id: artShapeIconComponent;
63 ProportionalShape { source: artShapeSource; aspect: UbuntuShape.DropShadow; }
64 }
65 }39 }
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;
67 readonly property real aspect: fixedArtShapeSizeAspect > 0 ? fixedArtShapeSizeAspect : 1.6;41 readonly property real aspect: fixedArtShapeSizeAspect > 0 ? fixedArtShapeSizeAspect : 1.6;
@@ -81,7 +55,8 @@
81 objectName: "artImage"; 55 objectName: "artImage";
82 source: artShapeLoader.cardArt;56 source: artShapeLoader.cardArt;
83 asynchronous: true;57 asynchronous: true;
84 width: root.width; 58 visible: false;
59 width: root.width;
85 height: width / artShape.aspect; 60 height: width / artShape.aspect;
86 } 61 }
87 } 62 }
@@ -112,7 +87,7 @@
112 id: touchdown;87 id: touchdown;
113 objectName: "touchdown";88 objectName: "touchdown";
114 anchors { fill: artShapeHolder }89 anchors { fill: artShapeHolder }
115 visible: root.artShapeStyle != "shadow" && root.artShapeStyle != "icon" && root.pressed;90 visible: root.pressed;
116 radius: "medium";91 radius: "medium";
117 borderSource: "radius_pressed.sci"92 borderSource: "radius_pressed.sci"
118}93}
11994
=== modified file 'tests/plugins/Dash/cardcreator/1.res.cardcreator'
--- tests/plugins/Dash/cardcreator/1.res.cardcreator 2016-02-17 10:51:17 +0000
+++ tests/plugins/Dash/cardcreator/1.res.cardcreator 2016-03-18 11:31:31 +0000
@@ -1,7 +1,6 @@
1AbstractButton { 1AbstractButton {
2 id: root; 2 id: root;
3 property var cardData; 3 property var cardData;
4 property string artShapeStyle: "inset";
5 property string backgroundShapeStyle: "inset"; 4 property string backgroundShapeStyle: "inset";
6 property real fontScale: 1.0; 5 property real fontScale: 1.0;
7 property var scopeStyle: null; 6 property var scopeStyle: null;
@@ -21,6 +20,7 @@
21 id: artShapeLoader; 20 id: artShapeLoader;
22 objectName: "artShapeLoader"; 21 objectName: "artShapeLoader";
23 readonly property string cardArt: cardData && cardData["art"] || "";22 readonly property string cardArt: cardData && cardData["art"] || "";
23 onCardArtChanged: { if (item) { item.image.source = cardArt; } }
24 active: cardArt != "";24 active: cardArt != "";
25 asynchronous: false;25 asynchronous: false;
26 visible: status == Loader.Ready; 26 visible: status == Loader.Ready;
@@ -29,38 +29,12 @@
29 objectName: "artShape";29 objectName: "artShape";
30 visible: image.status == Image.Ready;30 visible: image.status == Image.Ready;
31 readonly property alias image: artImage;31 readonly property alias image: artImage;
32 ShaderEffectSource {32 UbuntuShape {
33 id: artShapeSource;
34 sourceItem: artImage;
35 anchors.centerIn: parent;
36 width: 1;
37 height: 1;
38 hideSource: true;
39 }
40 Loader {
41 anchors.fill: parent;33 anchors.fill: parent;
42 visible: true;34 source: artImage;
43 sourceComponent: root.artShapeStyle === "icon" ? artShapeIconComponent : artShapeShapeComponent;35 sourceFillMode: UbuntuShape.PreserveAspectCrop;
44 Component {36 radius: "medium";
45 id: artShapeShapeComponent;37 aspect: UbuntuShape.Inset;
46 UbuntuShape {
47 source: artShapeSource;
48 sourceFillMode: UbuntuShape.PreserveAspectCrop;
49 radius: "medium";
50 aspect: {
51 switch (root.artShapeStyle) {
52 case "inset": return UbuntuShape.Inset;
53 case "shadow": return UbuntuShape.DropShadow;
54 default:
55 case "flat": return UbuntuShape.Flat;
56 }
57 }
58 }
59 }
60 Component {
61 id: artShapeIconComponent;
62 ProportionalShape { source: artShapeSource; aspect: UbuntuShape.DropShadow; }
63 }
64 }38 }
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;
66 readonly property real aspect: fixedArtShapeSizeAspect > 0 ? fixedArtShapeSizeAspect : 1.6;40 readonly property real aspect: fixedArtShapeSizeAspect > 0 ? fixedArtShapeSizeAspect : 1.6;
@@ -80,6 +54,7 @@
80 objectName: "artImage"; 54 objectName: "artImage";
81 source: artShapeLoader.cardArt;55 source: artShapeLoader.cardArt;
82 asynchronous: false;56 asynchronous: false;
57 visible: false;
83 width: root.width; 58 width: root.width;
84 height: width / artShape.aspect; 59 height: width / artShape.aspect;
85 } 60 }
@@ -111,7 +86,7 @@
111 id: touchdown;86 id: touchdown;
112 objectName: "touchdown";87 objectName: "touchdown";
113 anchors { fill: artShapeHolder }88 anchors { fill: artShapeHolder }
114 visible: root.artShapeStyle != "shadow" && root.artShapeStyle != "icon" && root.pressed;89 visible: root.pressed;
115 radius: "medium";90 radius: "medium";
116 borderSource: "radius_pressed.sci"91 borderSource: "radius_pressed.sci"
117}92}
11893
=== modified file 'tests/plugins/Dash/cardcreator/1.tst'
--- tests/plugins/Dash/cardcreator/1.tst 2014-08-08 08:54:12 +0000
+++ tests/plugins/Dash/cardcreator/1.tst 2016-03-18 11:31:31 +0000
@@ -1,3 +1,4 @@
1template: {"card-layout":"vertical","card-size":"small","category-layout":"grid","collapsed-rows":2}1template: {"card-layout":"vertical","card-size":"small","category-layout":"grid","collapsed-rows":2}
2components: {"art":{"aspect-ratio":1.6,"field":"art"},"title":{"field":"title"},"attributes":{}}2components: {"art":{"aspect-ratio":1.6,"field":"art"},"title":{"field":"title"},"attributes":{}}
3artShapeStyle: inset
3result: 1.res4result: 1.res
45
=== modified file 'tests/plugins/Dash/cardcreator/10.res'
--- tests/plugins/Dash/cardcreator/10.res 2016-02-17 10:51:17 +0000
+++ tests/plugins/Dash/cardcreator/10.res 2016-03-18 11:31:31 +0000
@@ -1,7 +1,6 @@
1AbstractButton { 1AbstractButton {
2 id: root; 2 id: root;
3 property var cardData; 3 property var cardData;
4 property string artShapeStyle: "inset";
5 property string backgroundShapeStyle: "inset"; 4 property string backgroundShapeStyle: "inset";
6 property real fontScale: 1.0; 5 property real fontScale: 1.0;
7 property var scopeStyle: null; 6 property var scopeStyle: null;
@@ -127,13 +126,5 @@
127 126
128 ] 127 ]
129 }128 }
130UbuntuShape {
131 id: touchdown;
132 objectName: "touchdown";
133 anchors { fill: backgroundLoader }
134 visible: root.artShapeStyle != "shadow" && root.artShapeStyle != "icon" && root.pressed;
135 radius: "medium";
136 borderSource: "radius_pressed.sci"
137 }
138implicitHeight: row.y + row.height + units.gu(1);129implicitHeight: row.y + row.height + units.gu(1);
139}130}
140131
=== modified file 'tests/plugins/Dash/cardcreator/10.res.cardcreator'
--- tests/plugins/Dash/cardcreator/10.res.cardcreator 2016-02-17 10:51:17 +0000
+++ tests/plugins/Dash/cardcreator/10.res.cardcreator 2016-03-18 11:31:31 +0000
@@ -1,7 +1,6 @@
1AbstractButton { 1AbstractButton {
2 id: root; 2 id: root;
3 property var cardData; 3 property var cardData;
4 property string artShapeStyle: "inset";
5 property string backgroundShapeStyle: "inset"; 4 property string backgroundShapeStyle: "inset";
6 property real fontScale: 1.0; 5 property real fontScale: 1.0;
7 property var scopeStyle: null; 6 property var scopeStyle: null;
@@ -125,13 +124,5 @@
125 124
126 ] 125 ]
127 }126 }
128UbuntuShape {
129 id: touchdown;
130 objectName: "touchdown";
131 anchors { fill: backgroundLoader }
132 visible: root.artShapeStyle != "shadow" && root.artShapeStyle != "icon" && root.pressed;
133 radius: "medium";
134 borderSource: "radius_pressed.sci"
135 }
136implicitHeight: row.y + row.height + units.gu(1);127implicitHeight: row.y + row.height + units.gu(1);
137}128}
138129
=== modified file 'tests/plugins/Dash/cardcreator/10.tst'
--- tests/plugins/Dash/cardcreator/10.tst 2016-01-25 16:49:26 +0000
+++ tests/plugins/Dash/cardcreator/10.tst 2016-03-18 11:31:31 +0000
@@ -1,3 +1,4 @@
1template: {"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 () { \"" ] } }1template: {"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 () { \"" ] } }
2components: {"art":{"aspect-ratio":1},"background":{"field":"background"},"mascot":{"field":"icon"},"subtitle":{"field":"author"},"title":{"field":"title"},"attributes":{}}2components: {"art":{"aspect-ratio":1},"background":{"field":"background"},"mascot":{"field":"icon"},"subtitle":{"field":"author"},"title":{"field":"title"},"attributes":{}}
3artShapeStyle: shadow
3result: 10.res4result: 10.res
4\ No newline at end of file5\ No newline at end of file
56
=== modified file 'tests/plugins/Dash/cardcreator/11.res'
--- tests/plugins/Dash/cardcreator/11.res 2016-02-17 10:51:17 +0000
+++ tests/plugins/Dash/cardcreator/11.res 2016-03-18 11:31:31 +0000
@@ -1,7 +1,6 @@
1AbstractButton { 1AbstractButton {
2 id: root; 2 id: root;
3 property var cardData; 3 property var cardData;
4 property string artShapeStyle: "inset";
5 property string backgroundShapeStyle: "inset"; 4 property string backgroundShapeStyle: "inset";
6 property real fontScale: 1.0; 5 property real fontScale: 1.0;
7 property var scopeStyle: null; 6 property var scopeStyle: null;
@@ -60,6 +59,7 @@
60 id: artShapeLoader; 59 id: artShapeLoader;
61 objectName: "artShapeLoader"; 60 objectName: "artShapeLoader";
62 readonly property string cardArt: cardData && cardData["art"] || decodeURI("%5C");61 readonly property string cardArt: cardData && cardData["art"] || decodeURI("%5C");
62 onCardArtChanged: { if (item) { item.image.source = cardArt; } }
63 active: cardArt != "";63 active: cardArt != "";
64 asynchronous: true;64 asynchronous: true;
65 visible: status == Loader.Ready; 65 visible: status == Loader.Ready;
@@ -68,40 +68,14 @@
68 objectName: "artShape"; 68 objectName: "artShape";
69 visible: image.status == Image.Ready; 69 visible: image.status == Image.Ready;
70 readonly property alias image: artImage; 70 readonly property alias image: artImage;
71 ShaderEffectSource { 71 UbuntuShape {
72 id: artShapeSource; 72 anchors.fill: parent;
73 sourceItem: artImage; 73 source: artImage;
74 anchors.centerIn: parent; 74 sourceFillMode: UbuntuShape.PreserveAspectCrop;
75 width: 1; 75 radius: "medium";
76 height: 1; 76 aspect: UbuntuShape.Flat;
77 hideSource: true;77 }
78 } 78 readonly property real fixedArtShapeSizeAspect: (root.fixedArtShapeSize.height > 0 && root.fixedArtShapeSize.width > 0) ? root.fixedArtShapeSize.width / root.fixedArtShapeSize.height : -1;
79 Loader {
80 anchors.fill: parent;
81 visible: true;
82 sourceComponent: root.artShapeStyle === "icon" ? artShapeIconComponent : artShapeShapeComponent;
83 Component {
84 id: artShapeShapeComponent;
85 UbuntuShape {
86 source: artShapeSource;
87 sourceFillMode: UbuntuShape.PreserveAspectCrop;
88 radius: "medium";
89 aspect: {
90 switch (root.artShapeStyle) {
91 case "inset": return UbuntuShape.Inset;
92 case "shadow": return UbuntuShape.DropShadow;
93 default:
94 case "flat": return UbuntuShape.Flat;
95 }
96 }
97 }
98 }
99 Component {
100 id: artShapeIconComponent;
101 ProportionalShape { source: artShapeSource; aspect: UbuntuShape.DropShadow; }
102 }
103 }
104 readonly property real fixedArtShapeSizeAspect: (root.fixedArtShapeSize.height > 0 && root.fixedArtShapeSize.width > 0) ? root.fixedArtShapeSize.width / root.fixedArtShapeSize.height : -1;
105 readonly property real aspect: fixedArtShapeSizeAspect > 0 ? fixedArtShapeSizeAspect : 1;79 readonly property real aspect: fixedArtShapeSizeAspect > 0 ? fixedArtShapeSizeAspect : 1;
106 Component.onCompleted: { updateWidthHeightBindings(); } 80 Component.onCompleted: { updateWidthHeightBindings(); }
107 Connections { target: root; onFixedArtShapeSizeChanged: updateWidthHeightBindings(); } 81 Connections { target: root; onFixedArtShapeSizeChanged: updateWidthHeightBindings(); }
@@ -119,6 +93,7 @@
119 objectName: "artImage"; 93 objectName: "artImage";
120 source: artShapeLoader.cardArt;94 source: artShapeLoader.cardArt;
121 asynchronous: true;95 asynchronous: true;
96 visible: false;
122 width: root.width; 97 width: root.width;
123 height: width / artShape.aspect; 98 height: width / artShape.aspect;
124 onStatusChanged: if (status === Image.Error) source = decodeURI("%5C");99 onStatusChanged: if (status === Image.Error) source = decodeURI("%5C");
@@ -206,7 +181,7 @@
206 id: touchdown; 181 id: touchdown;
207 objectName: "touchdown"; 182 objectName: "touchdown";
208 anchors { fill: backgroundLoader } 183 anchors { fill: backgroundLoader }
209 visible: root.artShapeStyle != "shadow" && root.artShapeStyle != "icon" && root.pressed; 184 visible: root.pressed;
210 radius: "medium"; 185 radius: "medium";
211 borderSource: "radius_pressed.sci" 186 borderSource: "radius_pressed.sci"
212 }187 }
213188
=== modified file 'tests/plugins/Dash/cardcreator/11.res.cardcreator'
--- tests/plugins/Dash/cardcreator/11.res.cardcreator 2016-02-17 10:51:17 +0000
+++ tests/plugins/Dash/cardcreator/11.res.cardcreator 2016-03-18 11:31:31 +0000
@@ -1,7 +1,6 @@
1AbstractButton { 1AbstractButton {
2 id: root; 2 id: root;
3 property var cardData; 3 property var cardData;
4 property string artShapeStyle: "inset";
5 property string backgroundShapeStyle: "inset"; 4 property string backgroundShapeStyle: "inset";
6 property real fontScale: 1.0; 5 property real fontScale: 1.0;
7 property var scopeStyle: null; 6 property var scopeStyle: null;
@@ -59,6 +58,7 @@
59 id: artShapeLoader; 58 id: artShapeLoader;
60 objectName: "artShapeLoader"; 59 objectName: "artShapeLoader";
61 readonly property string cardArt: cardData && cardData["art"] || "";60 readonly property string cardArt: cardData && cardData["art"] || "";
61 onCardArtChanged: { if (item) { item.image.source = cardArt; } }
62 active: cardArt != "";62 active: cardArt != "";
63 asynchronous: false;63 asynchronous: false;
64 visible: status == Loader.Ready; 64 visible: status == Loader.Ready;
@@ -67,39 +67,13 @@
67 objectName: "artShape"; 67 objectName: "artShape";
68 visible: image.status == Image.Ready; 68 visible: image.status == Image.Ready;
69 readonly property alias image: artImage; 69 readonly property alias image: artImage;
70 ShaderEffectSource { 70 UbuntuShape {
71 id: artShapeSource; 71 anchors.fill: parent;
72 sourceItem: artImage; 72 source: artImage;
73 anchors.centerIn: parent; 73 sourceFillMode: UbuntuShape.PreserveAspectCrop;
74 width: 1; 74 radius: "medium";
75 height: 1; 75 aspect: UbuntuShape.Flat;
76 hideSource: true;76 }
77 }
78 Loader {
79 anchors.fill: parent;
80 visible: true;
81 sourceComponent: root.artShapeStyle === "icon" ? artShapeIconComponent : artShapeShapeComponent;
82 Component {
83 id: artShapeShapeComponent;
84 UbuntuShape {
85 source: artShapeSource;
86 sourceFillMode: UbuntuShape.PreserveAspectCrop;
87 radius: "medium";
88 aspect: {
89 switch (root.artShapeStyle) {
90 case "inset": return UbuntuShape.Inset;
91 case "shadow": return UbuntuShape.DropShadow;
92 default:
93 case "flat": return UbuntuShape.Flat;
94 }
95 }
96 }
97 }
98 Component {
99 id: artShapeIconComponent;
100 ProportionalShape { source: artShapeSource; aspect: UbuntuShape.DropShadow; }
101 }
102 }
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;
104 readonly property real aspect: fixedArtShapeSizeAspect > 0 ? fixedArtShapeSizeAspect : 1;78 readonly property real aspect: fixedArtShapeSizeAspect > 0 ? fixedArtShapeSizeAspect : 1;
105 Component.onCompleted: { updateWidthHeightBindings(); } 79 Component.onCompleted: { updateWidthHeightBindings(); }
@@ -118,6 +92,7 @@
118 objectName: "artImage"; 92 objectName: "artImage";
119 source: artShapeLoader.cardArt;93 source: artShapeLoader.cardArt;
120 asynchronous: false;94 asynchronous: false;
95 visible: false;
121 width: root.width; 96 width: root.width;
122 height: width / artShape.aspect; 97 height: width / artShape.aspect;
123 } 98 }
@@ -202,7 +177,7 @@
202 id: touchdown; 177 id: touchdown;
203 objectName: "touchdown"; 178 objectName: "touchdown";
204 anchors { fill: backgroundLoader } 179 anchors { fill: backgroundLoader }
205 visible: root.artShapeStyle != "shadow" && root.artShapeStyle != "icon" && root.pressed; 180 visible: root.pressed;
206 radius: "medium"; 181 radius: "medium";
207 borderSource: "radius_pressed.sci" 182 borderSource: "radius_pressed.sci"
208 }183 }
209184
=== modified file 'tests/plugins/Dash/cardcreator/11.tst'
--- tests/plugins/Dash/cardcreator/11.tst 2016-01-25 16:49:26 +0000
+++ tests/plugins/Dash/cardcreator/11.tst 2016-03-18 11:31:31 +0000
@@ -1,3 +1,4 @@
1template: {"card-background":{"elements":["#E9E9E9"],"type":"color"},"card-layout":"vertical","card-size":"medium","category-layout":"grid","collapsed-rows":2 }1template: {"card-background":{"elements":["#E9E9E9"],"type":"color"},"card-layout":"vertical","card-size":"medium","category-layout":"grid","collapsed-rows":2 }
2components: {"art":{"aspect-ratio":1,"field":"art","fallback":"\\"},"background":{"field":"background"},"mascot":{"field":"icon","fallback":"\""},"subtitle":{"field":"author"},"title":{"field":"title"},"attributes":{}}2components: {"art":{"aspect-ratio":1,"field":"art","fallback":"\\"},"background":{"field":"background"},"mascot":{"field":"icon","fallback":"\""},"subtitle":{"field":"author"},"title":{"field":"title"},"attributes":{}}
3artShapeStyle: flat
3result: 11.res4result: 11.res
4\ No newline at end of file5\ No newline at end of file
56
=== modified file 'tests/plugins/Dash/cardcreator/2.res'
--- tests/plugins/Dash/cardcreator/2.res 2016-02-17 10:51:17 +0000
+++ tests/plugins/Dash/cardcreator/2.res 2016-03-18 11:31:31 +0000
@@ -1,7 +1,6 @@
1AbstractButton { 1AbstractButton {
2 id: root; 2 id: root;
3 property var cardData; 3 property var cardData;
4 property string artShapeStyle: "inset";
5 property string backgroundShapeStyle: "inset"; 4 property string backgroundShapeStyle: "inset";
6 property real fontScale: 1.0; 5 property real fontScale: 1.0;
7 property var scopeStyle: null; 6 property var scopeStyle: null;
@@ -126,13 +125,5 @@
126 125
127 ] 126 ]
128 }127 }
129UbuntuShape {
130 id: touchdown;
131 objectName: "touchdown";
132 anchors { fill: backgroundLoader }
133 visible: root.artShapeStyle != "shadow" && root.artShapeStyle != "icon" && root.pressed;
134 radius: "medium";
135 borderSource: "radius_pressed.sci"
136}
137implicitHeight: row.y + row.height + units.gu(1);128implicitHeight: row.y + row.height + units.gu(1);
138}129}
139130
=== modified file 'tests/plugins/Dash/cardcreator/2.res.cardcreator'
--- tests/plugins/Dash/cardcreator/2.res.cardcreator 2016-02-17 10:51:17 +0000
+++ tests/plugins/Dash/cardcreator/2.res.cardcreator 2016-03-18 11:31:31 +0000
@@ -1,7 +1,6 @@
1AbstractButton { 1AbstractButton {
2 id: root; 2 id: root;
3 property var cardData; 3 property var cardData;
4 property string artShapeStyle: "inset";
5 property string backgroundShapeStyle: "inset"; 4 property string backgroundShapeStyle: "inset";
6 property real fontScale: 1.0; 5 property real fontScale: 1.0;
7 property var scopeStyle: null; 6 property var scopeStyle: null;
@@ -124,13 +123,5 @@
124 123
125 ] 124 ]
126 }125 }
127UbuntuShape {
128 id: touchdown;
129 objectName: "touchdown";
130 anchors { fill: backgroundLoader }
131 visible: root.artShapeStyle != "shadow" && root.artShapeStyle != "icon" && root.pressed;
132 radius: "medium";
133 borderSource: "radius_pressed.sci"
134}
135implicitHeight: row.y + row.height + units.gu(1);126implicitHeight: row.y + row.height + units.gu(1);
136}127}
137128
=== modified file 'tests/plugins/Dash/cardcreator/2.tst'
--- tests/plugins/Dash/cardcreator/2.tst 2014-08-08 08:54:12 +0000
+++ tests/plugins/Dash/cardcreator/2.tst 2016-03-18 11:31:31 +0000
@@ -1,3 +1,4 @@
1template: {"card-background":{"elements":["#E9E9E9"],"type":"color"},"card-layout":"vertical","card-size":"medium","category-layout":"grid","collapsed-rows":2}1template: {"card-background":{"elements":["#E9E9E9"],"type":"color"},"card-layout":"vertical","card-size":"medium","category-layout":"grid","collapsed-rows":2}
2components: {"art":{"aspect-ratio":1},"background":{"field":"background"},"mascot":{"field":"icon"},"subtitle":{"field":"author"},"title":{"field":"title"},"attributes":{}}2components: {"art":{"aspect-ratio":1},"background":{"field":"background"},"mascot":{"field":"icon"},"subtitle":{"field":"author"},"title":{"field":"title"},"attributes":{}}
3artShapeStyle: icon
3result: 2.res4result: 2.res
45
=== modified file 'tests/plugins/Dash/cardcreator/3.res'
--- tests/plugins/Dash/cardcreator/3.res 2016-02-17 10:51:17 +0000
+++ tests/plugins/Dash/cardcreator/3.res 2016-03-18 11:31:31 +0000
@@ -1,7 +1,6 @@
1AbstractButton { 1AbstractButton {
2 id: root; 2 id: root;
3 property var cardData; 3 property var cardData;
4 property string artShapeStyle: "inset";
5 property string backgroundShapeStyle: "inset"; 4 property string backgroundShapeStyle: "inset";
6 property real fontScale: 1.0; 5 property real fontScale: 1.0;
7 property var scopeStyle: null; 6 property var scopeStyle: null;
@@ -22,6 +21,7 @@
22 id: artShapeLoader; 21 id: artShapeLoader;
23 objectName: "artShapeLoader"; 22 objectName: "artShapeLoader";
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");
24 onCardArtChanged: { if (item) { item.image.source = cardArt; } }
25 active: cardArt != "";25 active: cardArt != "";
26 asynchronous: true;26 asynchronous: true;
27 visible: status == Loader.Ready;27 visible: status == Loader.Ready;
@@ -30,38 +30,10 @@
30 objectName: "artShape";30 objectName: "artShape";
31 visible: image.status == Image.Ready;31 visible: image.status == Image.Ready;
32 readonly property alias image: artImage;32 readonly property alias image: artImage;
33 ShaderEffectSource {33 ProportionalShape {
34 id: artShapeSource;
35 sourceItem: artImage;
36 anchors.centerIn: parent;
37 width: 1;
38 height: 1;
39 hideSource: true;
40 }
41 Loader {
42 anchors.fill: parent;34 anchors.fill: parent;
43 visible: true;35 source: artImage;
44 sourceComponent: root.artShapeStyle === "icon" ? artShapeIconComponent : artShapeShapeComponent;36 aspect: UbuntuShape.DropShadow;
45 Component {
46 id: artShapeShapeComponent;
47 UbuntuShape {
48 source: artShapeSource;
49 sourceFillMode: UbuntuShape.PreserveAspectCrop;
50 radius: "medium";
51 aspect: {
52 switch (root.artShapeStyle) {
53 case "inset": return UbuntuShape.Inset;
54 case "shadow": return UbuntuShape.DropShadow;
55 default:
56 case "flat": return UbuntuShape.Flat;
57 }
58 }
59 }
60 }
61 Component {
62 id: artShapeIconComponent;
63 ProportionalShape { source: artShapeSource; aspect: UbuntuShape.DropShadow; }
64 }
65 }37 }
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;
67 readonly property real aspect: fixedArtShapeSizeAspect > 0 ? fixedArtShapeSizeAspect : 0.75;39 readonly property real aspect: fixedArtShapeSizeAspect > 0 ? fixedArtShapeSizeAspect : 0.75;
@@ -81,6 +53,7 @@
81 objectName: "artImage";53 objectName: "artImage";
82 source: artShapeLoader.cardArt;54 source: artShapeLoader.cardArt;
83 asynchronous: true;55 asynchronous: true;
56 visible: false;
84 width: root.width;57 width: root.width;
85 height: width / artShape.aspect;58 height: width / artShape.aspect;
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");
@@ -127,13 +100,5 @@
127 text: cardData && cardData["subtitle"] || ""; 100 text: cardData && cardData["subtitle"] || "";
128 font.weight: Font.Light; 101 font.weight: Font.Light;
129 }102 }
130UbuntuShape {
131 id: touchdown;
132 objectName: "touchdown";
133 anchors { fill: artShapeHolder }
134 visible: root.artShapeStyle != "shadow" && root.artShapeStyle != "icon" && root.pressed;
135 radius: "medium";
136 borderSource: "radius_pressed.sci"
137}
138implicitHeight: subtitleLabel.y + subtitleLabel.height + units.gu(1);103implicitHeight: subtitleLabel.y + subtitleLabel.height + units.gu(1);
139}104}
140105
=== modified file 'tests/plugins/Dash/cardcreator/3.res.cardcreator'
--- tests/plugins/Dash/cardcreator/3.res.cardcreator 2016-02-17 10:51:17 +0000
+++ tests/plugins/Dash/cardcreator/3.res.cardcreator 2016-03-18 11:31:31 +0000
@@ -1,7 +1,6 @@
1AbstractButton { 1AbstractButton {
2 id: root; 2 id: root;
3 property var cardData; 3 property var cardData;
4 property string artShapeStyle: "inset";
5 property string backgroundShapeStyle: "inset"; 4 property string backgroundShapeStyle: "inset";
6 property real fontScale: 1.0; 5 property real fontScale: 1.0;
7 property var scopeStyle: null; 6 property var scopeStyle: null;
@@ -21,6 +20,7 @@
21 id: artShapeLoader; 20 id: artShapeLoader;
22 objectName: "artShapeLoader"; 21 objectName: "artShapeLoader";
23 readonly property string cardArt: cardData && cardData["art"] || "";22 readonly property string cardArt: cardData && cardData["art"] || "";
23 onCardArtChanged: { if (item) { item.image.source = cardArt; } }
24 active: cardArt != "";24 active: cardArt != "";
25 asynchronous: false;25 asynchronous: false;
26 visible: status == Loader.Ready;26 visible: status == Loader.Ready;
@@ -29,38 +29,10 @@
29 objectName: "artShape";29 objectName: "artShape";
30 visible: image.status == Image.Ready;30 visible: image.status == Image.Ready;
31 readonly property alias image: artImage;31 readonly property alias image: artImage;
32 ShaderEffectSource {32 ProportionalShape {
33 id: artShapeSource;
34 sourceItem: artImage;
35 anchors.centerIn: parent;
36 width: 1;
37 height: 1;
38 hideSource: true;
39 }
40 Loader {
41 anchors.fill: parent;33 anchors.fill: parent;
42 visible: true;34 source: artImage;
43 sourceComponent: root.artShapeStyle === "icon" ? artShapeIconComponent : artShapeShapeComponent;35 aspect: UbuntuShape.DropShadow;
44 Component {
45 id: artShapeShapeComponent;
46 UbuntuShape {
47 source: artShapeSource;
48 sourceFillMode: UbuntuShape.PreserveAspectCrop;
49 radius: "medium";
50 aspect: {
51 switch (root.artShapeStyle) {
52 case "inset": return UbuntuShape.Inset;
53 case "shadow": return UbuntuShape.DropShadow;
54 default:
55 case "flat": return UbuntuShape.Flat;
56 }
57 }
58 }
59 }
60 Component {
61 id: artShapeIconComponent;
62 ProportionalShape { source: artShapeSource; aspect: UbuntuShape.DropShadow; }
63 }
64 }36 }
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;
66 readonly property real aspect: fixedArtShapeSizeAspect > 0 ? fixedArtShapeSizeAspect : 0.75;38 readonly property real aspect: fixedArtShapeSizeAspect > 0 ? fixedArtShapeSizeAspect : 0.75;
@@ -80,6 +52,7 @@
80 objectName: "artImage";52 objectName: "artImage";
81 source: artShapeLoader.cardArt;53 source: artShapeLoader.cardArt;
82 asynchronous: false;54 asynchronous: false;
55 visible: false;
83 width: root.width;56 width: root.width;
84 height: width / artShape.aspect;57 height: width / artShape.aspect;
85 }58 }
@@ -125,13 +98,5 @@
125 text: cardData && cardData["subtitle"] || ""; 98 text: cardData && cardData["subtitle"] || "";
126 font.weight: Font.Light; 99 font.weight: Font.Light;
127 }100 }
128UbuntuShape {
129 id: touchdown;
130 objectName: "touchdown";
131 anchors { fill: artShapeHolder }
132 visible: root.artShapeStyle != "shadow" && root.artShapeStyle != "icon" && root.pressed;
133 radius: "medium";
134 borderSource: "radius_pressed.sci"
135}
136implicitHeight: subtitleLabel.y + subtitleLabel.height + units.gu(1);101implicitHeight: subtitleLabel.y + subtitleLabel.height + units.gu(1);
137}102}
138103
=== modified file 'tests/plugins/Dash/cardcreator/3.tst'
--- tests/plugins/Dash/cardcreator/3.tst 2016-01-21 22:44:41 +0000
+++ tests/plugins/Dash/cardcreator/3.tst 2016-03-18 11:31:31 +0000
@@ -1,3 +1,4 @@
1template: {"card-layout":"vertical","card-size":"small","category-layout":"grid","collapsed-rows":2}1template: {"card-layout":"vertical","card-size":"small","category-layout":"grid","collapsed-rows":2}
2components: {"art":{"aspect-ratio":0.75,"field":"art","fallback":"IHAVE\\\"ESCAPED\\\"QUOTES\\\""},"subtitle":{"field":"price"},"title":{"field":"title"},"attributes":{}}2components: {"art":{"aspect-ratio":0.75,"field":"art","fallback":"IHAVE\\\"ESCAPED\\\"QUOTES\\\""},"subtitle":{"field":"price"},"title":{"field":"title"},"attributes":{}}
3artShapeStyle: icon
3result: 3.res4result: 3.res
45
=== modified file 'tests/plugins/Dash/cardcreator/4.res'
--- tests/plugins/Dash/cardcreator/4.res 2016-02-17 10:51:17 +0000
+++ tests/plugins/Dash/cardcreator/4.res 2016-03-18 11:31:31 +0000
@@ -1,7 +1,6 @@
1AbstractButton { 1AbstractButton {
2 id: root; 2 id: root;
3 property var cardData; 3 property var cardData;
4 property string artShapeStyle: "inset";
5 property string backgroundShapeStyle: "inset"; 4 property string backgroundShapeStyle: "inset";
6 property real fontScale: 1.0; 5 property real fontScale: 1.0;
7 property var scopeStyle: null;6 property var scopeStyle: null;
@@ -103,7 +102,7 @@
103 id: touchdown;102 id: touchdown;
104 objectName: "touchdown";103 objectName: "touchdown";
105 anchors { fill: root }104 anchors { fill: root }
106 visible: root.artShapeStyle != "shadow" && root.artShapeStyle != "icon" && root.pressed;105 visible: root.pressed;
107 radius: "medium";106 radius: "medium";
108 borderSource: "radius_pressed.sci"107 borderSource: "radius_pressed.sci"
109}108}
110109
=== modified file 'tests/plugins/Dash/cardcreator/4.res.cardcreator'
--- tests/plugins/Dash/cardcreator/4.res.cardcreator 2016-02-17 10:51:17 +0000
+++ tests/plugins/Dash/cardcreator/4.res.cardcreator 2016-03-18 11:31:31 +0000
@@ -1,7 +1,6 @@
1AbstractButton { 1AbstractButton {
2 id: root; 2 id: root;
3 property var cardData; 3 property var cardData;
4 property string artShapeStyle: "inset";
5 property string backgroundShapeStyle: "inset"; 4 property string backgroundShapeStyle: "inset";
6 property real fontScale: 1.0; 5 property real fontScale: 1.0;
7 property var scopeStyle: null;6 property var scopeStyle: null;
@@ -101,7 +100,7 @@
101 id: touchdown;100 id: touchdown;
102 objectName: "touchdown";101 objectName: "touchdown";
103 anchors { fill: root }102 anchors { fill: root }
104 visible: root.artShapeStyle != "shadow" && root.artShapeStyle != "icon" && root.pressed;103 visible: root.pressed;
105 radius: "medium";104 radius: "medium";
106 borderSource: "radius_pressed.sci"105 borderSource: "radius_pressed.sci"
107}106}
108107
=== modified file 'tests/plugins/Dash/cardcreator/4.tst'
--- tests/plugins/Dash/cardcreator/4.tst 2014-08-08 08:54:12 +0000
+++ tests/plugins/Dash/cardcreator/4.tst 2016-03-18 11:31:31 +0000
@@ -1,3 +1,4 @@
1template: {"card-layout":"horizontal","card-size":"large","category-layout":"grid","collapsed-rows":2}1template: {"card-layout":"horizontal","card-size":"large","category-layout":"grid","collapsed-rows":2}
2components: {"art":{"aspect-ratio":1},"mascot":{"field":"mascot"},"subtitle":{"field":"domain"},"title":{"field":"title"},"attributes":{}}2components: {"art":{"aspect-ratio":1},"mascot":{"field":"mascot"},"subtitle":{"field":"domain"},"title":{"field":"title"},"attributes":{}}
3artShapeStyle: flat
3result: 4.res4result: 4.res
45
=== modified file 'tests/plugins/Dash/cardcreator/5.res'
--- tests/plugins/Dash/cardcreator/5.res 2016-02-17 10:51:17 +0000
+++ tests/plugins/Dash/cardcreator/5.res 2016-03-18 11:31:31 +0000
@@ -1,7 +1,6 @@
1AbstractButton { 1AbstractButton {
2 id: root; 2 id: root;
3 property var cardData; 3 property var cardData;
4 property string artShapeStyle: "inset";
5 property string backgroundShapeStyle: "inset"; 4 property string backgroundShapeStyle: "inset";
6 property real fontScale: 1.0; 5 property real fontScale: 1.0;
7 property var scopeStyle: null; 6 property var scopeStyle: null;
@@ -22,6 +21,7 @@
22 id: artShapeLoader; 21 id: artShapeLoader;
23 objectName: "artShapeLoader"; 22 objectName: "artShapeLoader";
24 readonly property string cardArt: cardData && cardData["art"] || "";23 readonly property string cardArt: cardData && cardData["art"] || "";
24 onCardArtChanged: { if (item) { item.image.source = cardArt; } }
25 active: cardArt != "";25 active: cardArt != "";
26 asynchronous: true;26 asynchronous: true;
27 visible: status == Loader.Ready;27 visible: status == Loader.Ready;
@@ -30,39 +30,6 @@
30 objectName: "artShape";30 objectName: "artShape";
31 visible: image.status == Image.Ready;31 visible: image.status == Image.Ready;
32 readonly property alias image: artImage;32 readonly property alias image: artImage;
33 ShaderEffectSource {
34 id: artShapeSource;
35 sourceItem: artImage;
36 anchors.centerIn: parent;
37 width: 1;
38 height: 1;
39 hideSource: false;
40 }
41 Loader {
42 anchors.fill: parent;
43 visible: false;
44 sourceComponent: root.artShapeStyle === "icon" ? artShapeIconComponent : artShapeShapeComponent;
45 Component {
46 id: artShapeShapeComponent;
47 UbuntuShape {
48 source: artShapeSource;
49 sourceFillMode: UbuntuShape.PreserveAspectCrop;
50 radius: "medium";
51 aspect: {
52 switch (root.artShapeStyle) {
53 case "inset": return UbuntuShape.Inset;
54 case "shadow": return UbuntuShape.DropShadow;
55 default:
56 case "flat": return UbuntuShape.Flat;
57 }
58 }
59 }
60 }
61 Component {
62 id: artShapeIconComponent;
63 ProportionalShape { source: artShapeSource; aspect: UbuntuShape.DropShadow; }
64 }
65 }
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;
67 readonly property real aspect: fixedArtShapeSizeAspect > 0 ? fixedArtShapeSizeAspect : 1;34 readonly property real aspect: fixedArtShapeSizeAspect > 0 ? fixedArtShapeSizeAspect : 1;
68 Component.onCompleted: { updateWidthHeightBindings(); }35 Component.onCompleted: { updateWidthHeightBindings(); }
@@ -81,6 +48,7 @@
81 objectName: "artImage";48 objectName: "artImage";
82 source: artShapeLoader.cardArt;49 source: artShapeLoader.cardArt;
83 asynchronous: true;50 asynchronous: true;
51 visible: true;
84 width: root.width;52 width: root.width;
85 height: width / artShape.aspect;53 height: width / artShape.aspect;
86 }54 }
@@ -145,13 +113,5 @@
145 text: cardData && cardData["subtitle"] || ""; 113 text: cardData && cardData["subtitle"] || "";
146 font.weight: Font.Light; 114 font.weight: Font.Light;
147 }115 }
148UbuntuShape {
149 id: touchdown;
150 objectName: "touchdown";
151 anchors { fill: artShapeHolder }
152 visible: root.artShapeStyle != "shadow" && root.artShapeStyle != "icon" && root.pressed;
153 radius: "medium";
154 borderSource: "radius_pressed.sci"
155}
156implicitHeight: artShapeHolder.height;116implicitHeight: artShapeHolder.height;
157}117}
158118
=== modified file 'tests/plugins/Dash/cardcreator/5.res.cardcreator'
--- tests/plugins/Dash/cardcreator/5.res.cardcreator 2016-02-17 10:51:17 +0000
+++ tests/plugins/Dash/cardcreator/5.res.cardcreator 2016-03-18 11:31:31 +0000
@@ -1,7 +1,6 @@
1AbstractButton { 1AbstractButton {
2 id: root; 2 id: root;
3 property var cardData; 3 property var cardData;
4 property string artShapeStyle: "inset";
5 property string backgroundShapeStyle: "inset"; 4 property string backgroundShapeStyle: "inset";
6 property real fontScale: 1.0; 5 property real fontScale: 1.0;
7 property var scopeStyle: null; 6 property var scopeStyle: null;
@@ -21,6 +20,7 @@
21 id: artShapeLoader; 20 id: artShapeLoader;
22 objectName: "artShapeLoader"; 21 objectName: "artShapeLoader";
23 readonly property string cardArt: cardData && cardData["art"] || "";22 readonly property string cardArt: cardData && cardData["art"] || "";
23 onCardArtChanged: { if (item) { item.image.source = cardArt; } }
24 active: cardArt != "";24 active: cardArt != "";
25 asynchronous: false;25 asynchronous: false;
26 visible: status == Loader.Ready;26 visible: status == Loader.Ready;
@@ -29,39 +29,6 @@
29 objectName: "artShape";29 objectName: "artShape";
30 visible: image.status == Image.Ready;30 visible: image.status == Image.Ready;
31 readonly property alias image: artImage;31 readonly property alias image: artImage;
32 ShaderEffectSource {
33 id: artShapeSource;
34 sourceItem: artImage;
35 anchors.centerIn: parent;
36 width: 1;
37 height: 1;
38 hideSource: false;
39 }
40 Loader {
41 anchors.fill: parent;
42 visible: false;
43 sourceComponent: root.artShapeStyle === "icon" ? artShapeIconComponent : artShapeShapeComponent;
44 Component {
45 id: artShapeShapeComponent;
46 UbuntuShape {
47 source: artShapeSource;
48 sourceFillMode: UbuntuShape.PreserveAspectCrop;
49 radius: "medium";
50 aspect: {
51 switch (root.artShapeStyle) {
52 case "inset": return UbuntuShape.Inset;
53 case "shadow": return UbuntuShape.DropShadow;
54 default:
55 case "flat": return UbuntuShape.Flat;
56 }
57 }
58 }
59 }
60 Component {
61 id: artShapeIconComponent;
62 ProportionalShape { source: artShapeSource; aspect: UbuntuShape.DropShadow; }
63 }
64 }
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;
66 readonly property real aspect: fixedArtShapeSizeAspect > 0 ? fixedArtShapeSizeAspect : 1;33 readonly property real aspect: fixedArtShapeSizeAspect > 0 ? fixedArtShapeSizeAspect : 1;
67 Component.onCompleted: { updateWidthHeightBindings(); }34 Component.onCompleted: { updateWidthHeightBindings(); }
@@ -80,6 +47,7 @@
80 objectName: "artImage";47 objectName: "artImage";
81 source: artShapeLoader.cardArt;48 source: artShapeLoader.cardArt;
82 asynchronous: false;49 asynchronous: false;
50 visible: true;
83 width: root.width;51 width: root.width;
84 height: width / artShape.aspect;52 height: width / artShape.aspect;
85 }53 }
@@ -144,13 +112,5 @@
144 text: cardData && cardData["subtitle"] || ""; 112 text: cardData && cardData["subtitle"] || "";
145 font.weight: Font.Light; 113 font.weight: Font.Light;
146 }114 }
147UbuntuShape {
148 id: touchdown;
149 objectName: "touchdown";
150 anchors { fill: artShapeHolder }
151 visible: root.artShapeStyle != "shadow" && root.artShapeStyle != "icon" && root.pressed;
152 radius: "medium";
153 borderSource: "radius_pressed.sci"
154}
155implicitHeight: artShapeHolder.height;115implicitHeight: artShapeHolder.height;
156}116}
157117
=== modified file 'tests/plugins/Dash/cardcreator/5.tst'
--- tests/plugins/Dash/cardcreator/5.tst 2016-01-28 14:11:14 +0000
+++ tests/plugins/Dash/cardcreator/5.tst 2016-03-18 11:31:31 +0000
@@ -1,3 +1,4 @@
1template: {"non-interactive":true,"card-layout":"vertical","card-size":"medium","category-layout":"carousel","collapsed-rows":2,"overlay":true}1template: {"non-interactive":true,"card-layout":"vertical","card-size":"medium","category-layout":"carousel","collapsed-rows":2,"overlay":true}
2components: {"art":{"aspect-ratio":1,"field":"art","conciergeMode":true},"subtitle":{"field":"artist"},"title":{"field":"title"},"attributes":{}}2components: {"art":{"aspect-ratio":1,"field":"art","conciergeMode":true},"subtitle":{"field":"artist"},"title":{"field":"title"},"attributes":{}}
3artShapeStyle: shadow
3result: 5.res4result: 5.res
45
=== modified file 'tests/plugins/Dash/cardcreator/6.res'
--- tests/plugins/Dash/cardcreator/6.res 2016-02-17 10:51:17 +0000
+++ tests/plugins/Dash/cardcreator/6.res 2016-03-18 11:31:31 +0000
@@ -1,7 +1,6 @@
1AbstractButton {1AbstractButton {
2 id: root;2 id: root;
3 property var cardData;3 property var cardData;
4 property string artShapeStyle: "inset";
5 property string backgroundShapeStyle: "inset"; 4 property string backgroundShapeStyle: "inset";
6 property real fontScale: 1.0;5 property real fontScale: 1.0;
7 property var scopeStyle: null;6 property var scopeStyle: null;
@@ -119,7 +118,7 @@
119 id: touchdown;118 id: touchdown;
120 objectName: "touchdown";119 objectName: "touchdown";
121 anchors { fill: backgroundLoader }120 anchors { fill: backgroundLoader }
122 visible: root.artShapeStyle != "shadow" && root.artShapeStyle != "icon" && root.pressed;121 visible: root.pressed;
123 radius: "medium";122 radius: "medium";
124 borderSource: "radius_pressed.sci"123 borderSource: "radius_pressed.sci"
125}124}
126125
=== modified file 'tests/plugins/Dash/cardcreator/6.res.cardcreator'
--- tests/plugins/Dash/cardcreator/6.res.cardcreator 2016-02-17 10:51:17 +0000
+++ tests/plugins/Dash/cardcreator/6.res.cardcreator 2016-03-18 11:31:31 +0000
@@ -1,7 +1,6 @@
1AbstractButton {1AbstractButton {
2 id: root;2 id: root;
3 property var cardData;3 property var cardData;
4 property string artShapeStyle: "inset";
5 property string backgroundShapeStyle: "inset"; 4 property string backgroundShapeStyle: "inset";
6 property real fontScale: 1.0;5 property real fontScale: 1.0;
7 property var scopeStyle: null;6 property var scopeStyle: null;
@@ -118,7 +117,7 @@
118 id: touchdown;117 id: touchdown;
119 objectName: "touchdown";118 objectName: "touchdown";
120 anchors { fill: backgroundLoader }119 anchors { fill: backgroundLoader }
121 visible: root.artShapeStyle != "shadow" && root.artShapeStyle != "icon" && root.pressed;120 visible: root.pressed;
122 radius: "medium";121 radius: "medium";
123 borderSource: "radius_pressed.sci"122 borderSource: "radius_pressed.sci"
124}123}
125124
=== modified file 'tests/plugins/Dash/cardcreator/6.tst'
--- tests/plugins/Dash/cardcreator/6.tst 2015-05-13 10:21:18 +0000
+++ tests/plugins/Dash/cardcreator/6.tst 2016-03-18 11:31:31 +0000
@@ -1,3 +1,4 @@
1template: {"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}1template: {"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}
2components: {"art":{"aspect-ratio":1},"background":{"field":"background"},"subtitle":{"field":"author"},"title":{"field":"title"},"emblem":{"field":"source"},"attributes":{}}2components: {"art":{"aspect-ratio":1},"background":{"field":"background"},"subtitle":{"field":"author"},"title":{"field":"title"},"emblem":{"field":"source"},"attributes":{}}
3artShapeStyle: inset
3result: 6.res4result: 6.res
45
=== modified file 'tests/plugins/Dash/cardcreator/7.res'
--- tests/plugins/Dash/cardcreator/7.res 2016-02-17 10:51:17 +0000
+++ tests/plugins/Dash/cardcreator/7.res 2016-03-18 11:31:31 +0000
@@ -1,7 +1,6 @@
1AbstractButton { 1AbstractButton {
2 id: root; 2 id: root;
3 property var cardData; 3 property var cardData;
4 property string artShapeStyle: "inset";
5 property string backgroundShapeStyle: "inset"; 4 property string backgroundShapeStyle: "inset";
6 property real fontScale: 1.0; 5 property real fontScale: 1.0;
7 property var scopeStyle: null; 6 property var scopeStyle: null;
@@ -139,13 +138,5 @@
139 138
140 ] 139 ]
141 }140 }
142UbuntuShape {
143 id: touchdown;
144 objectName: "touchdown";
145 anchors { fill: backgroundLoader }
146 visible: root.artShapeStyle != "shadow" && root.artShapeStyle != "icon" && root.pressed;
147 radius: "medium";
148 borderSource: "radius_pressed.sci"
149}
150implicitHeight: row.y + row.height + units.gu(1);141implicitHeight: row.y + row.height + units.gu(1);
151}142}
152143
=== modified file 'tests/plugins/Dash/cardcreator/7.res.cardcreator'
--- tests/plugins/Dash/cardcreator/7.res.cardcreator 2016-02-17 10:51:17 +0000
+++ tests/plugins/Dash/cardcreator/7.res.cardcreator 2016-03-18 11:31:31 +0000
@@ -1,7 +1,6 @@
1AbstractButton { 1AbstractButton {
2 id: root; 2 id: root;
3 property var cardData; 3 property var cardData;
4 property string artShapeStyle: "inset";
5 property string backgroundShapeStyle: "inset"; 4 property string backgroundShapeStyle: "inset";
6 property real fontScale: 1.0; 5 property real fontScale: 1.0;
7 property var scopeStyle: null; 6 property var scopeStyle: null;
@@ -137,13 +136,5 @@
137 136
138 ] 137 ]
139 }138 }
140UbuntuShape {
141 id: touchdown;
142 objectName: "touchdown";
143 anchors { fill: backgroundLoader }
144 visible: root.artShapeStyle != "shadow" && root.artShapeStyle != "icon" && root.pressed;
145 radius: "medium";
146 borderSource: "radius_pressed.sci"
147}
148implicitHeight: row.y + row.height + units.gu(1);139implicitHeight: row.y + row.height + units.gu(1);
149}140}
150141
=== modified file 'tests/plugins/Dash/cardcreator/7.tst'
--- tests/plugins/Dash/cardcreator/7.tst 2015-05-13 10:21:18 +0000
+++ tests/plugins/Dash/cardcreator/7.tst 2016-03-18 11:31:31 +0000
@@ -1,3 +1,4 @@
1template: {"card-background":{"elements":["#E9E9E9","#E9AAE9"],"type":"color"},"card-layout":"vertical","card-size":"medium","category-layout":"grid","collapsed-rows":2}1template: {"card-background":{"elements":["#E9E9E9","#E9AAE9"],"type":"color"},"card-layout":"vertical","card-size":"medium","category-layout":"grid","collapsed-rows":2}
2components: {"art":{"aspect-ratio":1},"background":{"field":"background"},"mascot":{"field":"icon"},"subtitle":{"field":"author"},"title":{"field":"title"},"attributes":{"field":"attributes","max-count":2}}2components: {"art":{"aspect-ratio":1},"background":{"field":"background"},"mascot":{"field":"icon"},"subtitle":{"field":"author"},"title":{"field":"title"},"attributes":{"field":"attributes","max-count":2}}
3artShapeStyle: icon
3result: 7.res4result: 7.res
45
=== modified file 'tests/plugins/Dash/cardcreator/8.res'
--- tests/plugins/Dash/cardcreator/8.res 2016-02-17 10:51:17 +0000
+++ tests/plugins/Dash/cardcreator/8.res 2016-03-18 11:31:31 +0000
@@ -1,7 +1,6 @@
1AbstractButton { 1AbstractButton {
2 id: root; 2 id: root;
3 property var cardData;3 property var cardData;
4 property string artShapeStyle: "inset";
5 property string backgroundShapeStyle: "inset"; 4 property string backgroundShapeStyle: "inset";
6 property real fontScale: 1.0; 5 property real fontScale: 1.0;
7 property var scopeStyle: null; 6 property var scopeStyle: null;
@@ -101,7 +100,7 @@
101 id: touchdown;100 id: touchdown;
102 objectName: "touchdown";101 objectName: "touchdown";
103 anchors { fill: backgroundLoader }102 anchors { fill: backgroundLoader }
104 visible: root.artShapeStyle != "shadow" && root.artShapeStyle != "icon" && root.pressed;103 visible: root.pressed;
105 radius: "medium";104 radius: "medium";
106 borderSource: "radius_pressed.sci"105 borderSource: "radius_pressed.sci"
107}106}
108107
=== modified file 'tests/plugins/Dash/cardcreator/8.res.cardcreator'
--- tests/plugins/Dash/cardcreator/8.res.cardcreator 2016-02-17 10:51:17 +0000
+++ tests/plugins/Dash/cardcreator/8.res.cardcreator 2016-03-18 11:31:31 +0000
@@ -1,7 +1,6 @@
1AbstractButton { 1AbstractButton {
2 id: root; 2 id: root;
3 property var cardData;3 property var cardData;
4 property string artShapeStyle: "inset";
5 property string backgroundShapeStyle: "inset"; 4 property string backgroundShapeStyle: "inset";
6 property real fontScale: 1.0; 5 property real fontScale: 1.0;
7 property var scopeStyle: null; 6 property var scopeStyle: null;
@@ -99,7 +98,7 @@
99 id: touchdown;98 id: touchdown;
100 objectName: "touchdown";99 objectName: "touchdown";
101 anchors { fill: backgroundLoader }100 anchors { fill: backgroundLoader }
102 visible: root.artShapeStyle != "shadow" && root.artShapeStyle != "icon" && root.pressed;101 visible: root.pressed;
103 radius: "medium";102 radius: "medium";
104 borderSource: "radius_pressed.sci"103 borderSource: "radius_pressed.sci"
105}104}
106105
=== modified file 'tests/plugins/Dash/cardcreator/8.tst'
--- tests/plugins/Dash/cardcreator/8.tst 2015-06-22 08:29:55 +0000
+++ tests/plugins/Dash/cardcreator/8.tst 2016-03-18 11:31:31 +0000
@@ -1,3 +1,4 @@
1template: {"card-background":{"elements":["#E9E9E9","#E9AAE9"],"type":"color"},"card-layout":"vertical","card-size":"medium","category-layout":"grid","collapsed-rows":2}1template: {"card-background":{"elements":["#E9E9E9","#E9AAE9"],"type":"color"},"card-layout":"vertical","card-size":"medium","category-layout":"grid","collapsed-rows":2}
2components: {"background":{"field":"background"},"mascot":{"field":"icon"},"title":{"field":"title"},"attributes":{}}2components: {"background":{"field":"background"},"mascot":{"field":"icon"},"title":{"field":"title"},"attributes":{}}
3artShapeStyle: inset
3result: 8.res4result: 8.res
45
=== modified file 'tests/plugins/Dash/cardcreator/9.res'
--- tests/plugins/Dash/cardcreator/9.res 2016-03-10 16:53:04 +0000
+++ tests/plugins/Dash/cardcreator/9.res 2016-03-18 11:31:31 +0000
@@ -1,7 +1,6 @@
1AbstractButton { 1AbstractButton {
2 id: root; 2 id: root;
3 property var cardData; 3 property var cardData;
4 property string artShapeStyle: "inset";
5 property string backgroundShapeStyle: "inset"; 4 property string backgroundShapeStyle: "inset";
6 property real fontScale: 1.0; 5 property real fontScale: 1.0;
7 property var scopeStyle: null; 6 property var scopeStyle: null;
@@ -112,7 +111,7 @@
112 id: touchdown; 111 id: touchdown;
113 objectName: "touchdown"; 112 objectName: "touchdown";
114 anchors { fill: root } 113 anchors { fill: root }
115 visible: root.artShapeStyle != "shadow" && root.artShapeStyle != "icon" && root.pressed; 114 visible: root.pressed;
116 radius: "medium"; 115 radius: "medium";
117 borderSource: "radius_pressed.sci" 116 borderSource: "radius_pressed.sci"
118 }117 }
119118
=== modified file 'tests/plugins/Dash/cardcreator/9.res.cardcreator'
--- tests/plugins/Dash/cardcreator/9.res.cardcreator 2016-03-10 16:53:04 +0000
+++ tests/plugins/Dash/cardcreator/9.res.cardcreator 2016-03-18 11:31:31 +0000
@@ -1,7 +1,6 @@
1AbstractButton { 1AbstractButton {
2 id: root; 2 id: root;
3 property var cardData; 3 property var cardData;
4 property string artShapeStyle: "inset";
5 property string backgroundShapeStyle: "inset"; 4 property string backgroundShapeStyle: "inset";
6 property real fontScale: 1.0; 5 property real fontScale: 1.0;
7 property var scopeStyle: null; 6 property var scopeStyle: null;
@@ -111,7 +110,7 @@
111 id: touchdown; 110 id: touchdown;
112 objectName: "touchdown"; 111 objectName: "touchdown";
113 anchors { fill: root } 112 anchors { fill: root }
114 visible: root.artShapeStyle != "shadow" && root.artShapeStyle != "icon" && root.pressed; 113 visible: root.pressed;
115 radius: "medium"; 114 radius: "medium";
116 borderSource: "radius_pressed.sci" 115 borderSource: "radius_pressed.sci"
117 }116 }
118117
=== modified file 'tests/plugins/Dash/cardcreator/9.tst'
--- tests/plugins/Dash/cardcreator/9.tst 2015-07-06 07:52:35 +0000
+++ tests/plugins/Dash/cardcreator/9.tst 2016-03-18 11:31:31 +0000
@@ -1,3 +1,4 @@
1template: {"card-layout":"horizontal","card-size":"medium","category-layout":"grid","collapsed-rows":2,"quick-preview-type": "audio"}1template: {"card-layout":"horizontal","card-size":"medium","category-layout":"grid","collapsed-rows":2,"quick-preview-type": "audio"}
2components: {"art":{"aspect-ratio":1},"subtitle":{"field":"author"},"title":{"field":"title"}, "quickPreviewData": "quickPreviewData"}2components: {"art":{"aspect-ratio":1},"subtitle":{"field":"author"},"title":{"field":"title"}, "quickPreviewData": "quickPreviewData"}
3artShapeStyle: inset
3result: 9.res4result: 9.res
45
=== modified file 'tests/plugins/Dash/cardcreatortest.cpp'
--- tests/plugins/Dash/cardcreatortest.cpp 2016-02-16 13:34:54 +0000
+++ tests/plugins/Dash/cardcreatortest.cpp 2016-03-18 11:31:31 +0000
@@ -73,6 +73,7 @@
73 {73 {
74 const QString templateString("template: ");74 const QString templateString("template: ");
75 const QString componentsString("components: ");75 const QString componentsString("components: ");
76 const QString artShapeStyleString("artShapeStyle: ");
76 const QString resultString("result: ");77 const QString resultString("result: ");
7778
78 const QString testDirPath = DASHVIEWSTEST_FOLDER "/cardcreator/";79 const QString testDirPath = DASHVIEWSTEST_FOLDER "/cardcreator/";
@@ -87,24 +88,26 @@
8788
88 QVERIFY(lines[0].startsWith(templateString));89 QVERIFY(lines[0].startsWith(templateString));
89 QVERIFY(lines[1].startsWith(componentsString));90 QVERIFY(lines[1].startsWith(componentsString));
90 QVERIFY(lines[2].startsWith(resultString));91 QVERIFY(lines[2].startsWith(artShapeStyleString));
92 QVERIFY(lines[3].startsWith(resultString));
9193
92 const QString templateJSON = lines[0].mid(templateString.length());94 const QString templateJSON = lines[0].mid(templateString.length());
93 const QString componentsJSON = lines[1].mid(componentsString.length());95 const QString componentsJSON = lines[1].mid(componentsString.length());
94 const QString resultFileName = lines[2].mid(resultString.length());96 const QString artShapeStyle = lines[2].mid(artShapeStyleString.length());
97 const QString resultFileName = lines[3].mid(resultString.length());
95 QVariant cardStringResult;98 QVariant cardStringResult;
96 QVariant createCardComponentResult;99 QVariant createCardComponentResult;
97100
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));
99 compareFileContents(testDirPath + resultFileName, cardStringResult.toString());102 compareFileContents(testDirPath + resultFileName, cardStringResult.toString());
100103
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));
102 compareFileContents(testDirPath + resultFileName + ".cardcreator", cardStringResult.toString());105 compareFileContents(testDirPath + resultFileName + ".cardcreator", cardStringResult.toString());
103106
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));
105 QVERIFY(createCardComponentResult.toBool());108 QVERIFY(createCardComponentResult.toBool());
106109
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));
108 QVERIFY(createCardComponentResult.toBool());111 QVERIFY(createCardComponentResult.toBool());
109 }112 }
110 }113 }
111114
=== modified file 'tests/plugins/Dash/cardcreatortest.qml'
--- tests/plugins/Dash/cardcreatortest.qml 2016-02-16 13:34:54 +0000
+++ tests/plugins/Dash/cardcreatortest.qml 2016-03-18 11:31:31 +0000
@@ -19,11 +19,11 @@
1919
20Item {20Item {
21 id: root21 id: root
22 function cardString(template, components, isCardCreator) {22 function cardString(template, components, isCardCreator, artShapeStyle) {
23 return CardCreator.cardString(JSON.parse(template), JSON.parse(components), isCardCreator);23 return CardCreator.cardString(JSON.parse(template), JSON.parse(components), isCardCreator, artShapeStyle);
24 }24 }
2525
26 function createCardComponent(template, components, isCardCreator) {26 function createCardComponent(template, components, isCardCreator, artShapeStyle) {
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;
28 }28 }
29}29}
3030
=== modified file 'tests/qmltests/Dash/tst_Card.qml'
--- tests/qmltests/Dash/tst_Card.qml 2016-02-11 13:13:31 +0000
+++ tests/qmltests/Dash/tst_Card.qml 2016-03-18 11:31:31 +0000
@@ -485,6 +485,18 @@
485 tryCompare(art, "visible", true);485 tryCompare(art, "visible", true);
486 compare(artImage.source, Qt.resolvedUrl("artwork/checkers.png"));486 compare(artImage.source, Qt.resolvedUrl("artwork/checkers.png"));
487487
488 card.cardData["art"] = "somethingbroken";
489 card.cardDataChanged();
490 waitForRendering(card);
491 tryCompare(art, "visible", true);
492 compare(artImage.source, Qt.resolvedUrl("artwork/checkers.png"));
493
494 card.cardData["art"] = Qt.resolvedUrl("artwork/music-player-design.png");
495 card.cardDataChanged();
496 waitForRendering(card);
497 tryCompare(art, "visible", true);
498 compare(artImage.source, Qt.resolvedUrl("artwork/music-player-design.png"));
499
488 card.cardData["mascot"] = "somethingbroken2";500 card.cardData["mascot"] = "somethingbroken2";
489 card.cardDataChanged();501 card.cardDataChanged();
490 compare(mascotImage.status, Image.Error);502 compare(mascotImage.status, Image.Error);

Subscribers

People subscribed via source and target branches