on xenial help sign in
Unbox the artshapeLoader
8b0ff4aAlbert Astals Cid
plugins/Dash/CardCreator.js+70−78
@@ -25,7 +25,7 @@ var kBackgroundLoaderCode = 'Loader {\n\
25 objectName: "backgroundLoader"; \n\
25 objectName: "backgroundLoader"; \n\
26 anchors.fill: parent; \n\
26 anchors.fill: parent; \n\
27 asynchronous: %3; \n\
27 asynchronous: %3; \n\
28− visible: status == Loader.Ready; \n\
28+ visible: status === Loader.Ready; \n\
29 sourceComponent: UbuntuShape { \n\
29 sourceComponent: UbuntuShape { \n\
30 objectName: "background"; \n\
30 objectName: "background"; \n\
31 radius: "medium"; \n\
31 radius: "medium"; \n\
@@ -75,7 +75,7 @@ var kArtProportionalShapeCode = 'ProportionalShape { \n\
75 aspect: UbuntuShape.DropShadow; \n\
75 aspect: UbuntuShape.DropShadow; \n\
76 }';
76 }';
77
77
78−// %1 is used as anchors of artShapeHolder
78+// %1 is used as anchors of artShapeLoader
79// %2 is used as image width
79// %2 is used as image width
80// %3 is used as image height
80// %3 is used as image height
81// %4 is whether the image should be visible
81// %4 is whether the image should be visible
@@ -83,42 +83,39 @@ var kArtProportionalShapeCode = 'ProportionalShape { \n\
83// %6 is the shape code we want to use
83// %6 is the shape code we want to use
84// %7 is injected as code to artImage
84// %7 is injected as code to artImage
85// %8 is used as image fallback
85// %8 is used as image fallback
86−var kArtShapeHolderCode = 'Item { \n\
86+var kArtShapeHolderCode = 'Loader { \n\
87− id: artShapeHolder; \n\
87+ id: artShapeLoader; \n\
88 height: root.fixedArtShapeSize.height; \n\
88 height: root.fixedArtShapeSize.height; \n\
89 width: root.fixedArtShapeSize.width; \n\
89 width: root.fixedArtShapeSize.width; \n\
90 anchors { %1 } \n\
90 anchors { %1 } \n\
91− Loader { \n\
92− id: artShapeLoader; \n\
93− objectName: "artShapeLoader"; \n\
91+ objectName: "artShapeLoader"; \n\
94− readonly property string cardArt: cardData && cardData["art"] || %8; \n\
92+ readonly property string cardArt: cardData && cardData["art"] || %8; \n\
95− onCardArtChanged: { if (item) { item.image.source = cardArt; } } \n\
93+ onCardArtChanged: { if (item) { item.image.source = cardArt; } } \n\
96− active: cardArt != ""; \n\
94+ active: cardArt != ""; \n\
97− asynchronous: %5; \n\
95+ asynchronous: %5; \n\
98− visible: status == Loader.Ready; \n\
96+ visible: status === Loader.Ready; \n\
99− sourceComponent: Item { \n\
97+ sourceComponent: Item { \n\
100− id: artShape; \n\
98+ id: artShape; \n\
101− objectName: "artShape"; \n\
99+ objectName: "artShape"; \n\
102− visible: image.status == Image.Ready; \n\
100+ visible: image.status === Image.Ready; \n\
103− readonly property alias image: artImage; \n\
101+ readonly property alias image: artImage; \n\
104− %6 \n\
102+ %6 \n\
105− width: root.fixedArtShapeSize.width; \n\
103+ width: root.fixedArtShapeSize.width; \n\
106− height: root.fixedArtShapeSize.height; \n\
104+ height: root.fixedArtShapeSize.height; \n\
107− CroppedImageMinimumSourceSize { \n\
105+ CroppedImageMinimumSourceSize { \n\
108− id: artImage; \n\
106+ id: artImage; \n\
109− objectName: "artImage"; \n\
107+ objectName: "artImage"; \n\
110− source: artShapeLoader.cardArt; \n\
108+ source: artShapeLoader.cardArt; \n\
111− asynchronous: %5; \n\
109+ asynchronous: %5; \n\
112− visible: %4; \n\
110+ visible: %4; \n\
113− width: %2; \n\
111+ width: %2; \n\
114− height: %3; \n\
112+ height: %3; \n\
115− %7 \n\
113+ %7 \n\
116− } \n\
117 } \n\
114 } \n\
118 } \n\
115 } \n\
119 }\n';
116 }\n';
120
117
121−// %1 is used as anchors of artShapeHolder
118+// %1 is used as anchors of artShapeLoader
122// %2 is used as image width
119// %2 is used as image width
123// %3 is used as image height
120// %3 is used as image height
124// %4 is whether the image should be visible
121// %4 is whether the image should be visible
@@ -126,37 +123,32 @@ var kArtShapeHolderCode = 'Item { \n\
126// %6 is the shape code we want to use
123// %6 is the shape code we want to use
127// %7 is injected as code to artImage
124// %7 is injected as code to artImage
128// %8 is used as image fallback
125// %8 is used as image fallback
129−var kArtShapeHolderCodeCardToolCard = 'Item { \n\
126+var kArtShapeHolderCodeCardToolCard = 'Loader { \n\
130− id: artShapeHolder; \n\
131− height: artShapeLoader.height; \n\
132− width: artShapeLoader.width; \n\
127+ id: artShapeLoader; \n\
133 anchors { %1 } \n\
128 anchors { %1 } \n\
134− Loader { \n\
135− id: artShapeLoader; \n\
136− objectName: "artShapeLoader"; \n\
129+ objectName: "artShapeLoader"; \n\
137− readonly property string cardArt: cardData && cardData["art"] || %8; \n\
130+ readonly property string cardArt: cardData && cardData["art"] || %8; \n\
138− onCardArtChanged: { if (item) { item.image.source = cardArt; } } \n\
131+ onCardArtChanged: { if (item) { item.image.source = cardArt; } } \n\
139− active: cardArt != ""; \n\
132+ active: cardArt != ""; \n\
140− asynchronous: %5; \n\
133+ asynchronous: %5; \n\
141− visible: status == Loader.Ready; \n\
134+ visible: status === Loader.Ready; \n\
142− sourceComponent: Item { \n\
135+ sourceComponent: Item { \n\
143− id: artShape; \n\
136+ id: artShape; \n\
144− objectName: "artShape"; \n\
137+ objectName: "artShape"; \n\
145− visible: image.status == Image.Ready; \n\
138+ visible: image.status === Image.Ready; \n\
146− readonly property alias image: artImage; \n\
139+ readonly property alias image: artImage; \n\
147− %6 \n\
140+ %6 \n\
148− width: image.status !== Image.Ready ? 0 : image.width; \n\
141+ width: image.status !== Image.Ready ? 0 : image.width; \n\
149− height: image.status !== Image.Ready ? 0 : image.height; \n\
142+ height: image.status !== Image.Ready ? 0 : image.height; \n\
150− CroppedImageMinimumSourceSize { \n\
143+ CroppedImageMinimumSourceSize { \n\
151− id: artImage; \n\
144+ id: artImage; \n\
152− objectName: "artImage"; \n\
145+ objectName: "artImage"; \n\
153− source: artShapeLoader.cardArt; \n\
146+ source: artShapeLoader.cardArt; \n\
154− asynchronous: %5; \n\
147+ asynchronous: %5; \n\
155− visible: %4; \n\
148+ visible: %4; \n\
156− width: %2; \n\
149+ width: %2; \n\
157− height: %3; \n\
150+ height: %3; \n\
158− %7 \n\
151+ %7 \n\
159− } \n\
160 } \n\
152 } \n\
161 } \n\
153 } \n\
162 }\n';
154 }\n';
@@ -214,10 +206,10 @@ var kAudioButtonCode = 'AbstractButton { \n\
214var kOverlayLoaderCode = 'Loader { \n\
206var kOverlayLoaderCode = 'Loader { \n\
215 id: overlayLoader; \n\
207 id: overlayLoader; \n\
216 readonly property real overlayHeight: %2 + units.gu(2); \n\
208 readonly property real overlayHeight: %2 + units.gu(2); \n\
217− anchors.fill: artShapeHolder; \n\
209+ anchors.fill: artShapeLoader; \n\
218 active: artShapeLoader.active && artShapeLoader.item && artShapeLoader.item.image.status === Image.Ready || false; \n\
210 active: artShapeLoader.active && artShapeLoader.item && artShapeLoader.item.image.status === Image.Ready || false; \n\
219 asynchronous: %1; \n\
211 asynchronous: %1; \n\
220− visible: showHeader && status == Loader.Ready; \n\
212+ visible: showHeader && status === Loader.Ready; \n\
221 sourceComponent: UbuntuShapeOverlay { \n\
213 sourceComponent: UbuntuShapeOverlay { \n\
222 id: overlay; \n\
214 id: overlay; \n\
223 property real luminance: Style.luminance(overlayColor); \n\
215 property real luminance: Style.luminance(overlayColor); \n\
@@ -274,7 +266,7 @@ var kMascotShapeLoaderCode = 'Loader { \n\
274 objectName: "mascotShapeLoader"; \n\
266 objectName: "mascotShapeLoader"; \n\
275 asynchronous: %2; \n\
267 asynchronous: %2; \n\
276 active: mascotImage.status === Image.Ready; \n\
268 active: mascotImage.status === Image.Ready; \n\
277− visible: showHeader && active && status == Loader.Ready; \n\
269+ visible: showHeader && active && status === Loader.Ready; \n\
278 width: units.gu(6); \n\
270 width: units.gu(6); \n\
279 height: units.gu(5.625); \n\
271 height: units.gu(5.625); \n\
280 sourceComponent: UbuntuShape { image: mascotImage } \n\
272 sourceComponent: UbuntuShape { image: mascotImage } \n\
@@ -592,15 +584,15 @@ function cardString(template, components, isCardTool, artShapeStyle) {
592
584
593 var headerVerticalAnchors;
585 var headerVerticalAnchors;
594 if (headerAsOverlay) {
586 if (headerAsOverlay) {
595− headerVerticalAnchors = 'bottom: artShapeHolder.bottom; \n\
587+ headerVerticalAnchors = 'bottom: artShapeLoader.bottom; \n\
596 bottomMargin: units.gu(1);\n';
588 bottomMargin: units.gu(1);\n';
597 } else {
589 } else {
598 if (hasArt) {
590 if (hasArt) {
599 if (isHorizontal) {
591 if (isHorizontal) {
600− headerVerticalAnchors = 'top: artShapeHolder.top; \n\
592+ headerVerticalAnchors = 'top: artShapeLoader.top; \n\
601 topMargin: units.gu(1);\n';
593 topMargin: units.gu(1);\n';
602 } else {
594 } else {
603− headerVerticalAnchors = 'top: artShapeHolder.bottom; \n\
595+ headerVerticalAnchors = 'top: artShapeLoader.bottom; \n\
604 topMargin: units.gu(1);\n';
596 topMargin: units.gu(1);\n';
605 }
597 }
606 } else {
598 } else {
@@ -612,7 +604,7 @@ function cardString(template, components, isCardTool, artShapeStyle) {
612 var headerLeftAnchor;
604 var headerLeftAnchor;
613 var headerLeftAnchorHasMargin = false;
605 var headerLeftAnchorHasMargin = false;
614 if (isHorizontal && hasArt) {
606 if (isHorizontal && hasArt) {
615− headerLeftAnchor = 'left: artShapeHolder.right; \n\
607+ headerLeftAnchor = 'left: artShapeLoader.right; \n\
616 leftMargin: units.gu(1);\n';
608 leftMargin: units.gu(1);\n';
617 headerLeftAnchorHasMargin = true;
609 headerLeftAnchorHasMargin = true;
618 } else if (isHorizontal && isAudio) {
610 } else if (isHorizontal && isAudio) {
@@ -866,7 +858,7 @@ function cardString(template, components, isCardTool, artShapeStyle) {
866 var audioButtonWidth;
858 var audioButtonWidth;
867 var audioButtonHeight;
859 var audioButtonHeight;
868 if (hasArt) {
860 if (hasArt) {
869− audioButtonAnchorsFill = 'artShapeHolder';
861+ audioButtonAnchorsFill = 'artShapeLoader';
870 audioButtonWidth = 'undefined';
862 audioButtonWidth = 'undefined';
871 audioButtonHeight = 'undefined';
863 audioButtonHeight = 'undefined';
872 } else {
864 } else {
@@ -880,15 +872,15 @@ function cardString(template, components, isCardTool, artShapeStyle) {
880
872
881 if (hasSummary) {
873 if (hasSummary) {
882 var summaryTopAnchor;
874 var summaryTopAnchor;
883− if (isHorizontal && hasArt) summaryTopAnchor = 'artShapeHolder.bottom';
875+ if (isHorizontal && hasArt) summaryTopAnchor = 'artShapeLoader.bottom';
884− else if (headerAsOverlay && hasArt) summaryTopAnchor = 'artShapeHolder.bottom';
876+ else if (headerAsOverlay && hasArt) summaryTopAnchor = 'artShapeLoader.bottom';
885 else if (hasHeaderRow) summaryTopAnchor = 'row.bottom';
877 else if (hasHeaderRow) summaryTopAnchor = 'row.bottom';
886 else if (hasTitleContainer) summaryTopAnchor = 'headerTitleContainer.bottom';
878 else if (hasTitleContainer) summaryTopAnchor = 'headerTitleContainer.bottom';
887 else if (hasMascot) summaryTopAnchor = 'mascotImage.bottom';
879 else if (hasMascot) summaryTopAnchor = 'mascotImage.bottom';
888 else if (hasAttributes) summaryTopAnchor = 'attributesRow.bottom';
880 else if (hasAttributes) summaryTopAnchor = 'attributesRow.bottom';
889 else if (hasSubtitle) summaryTopAnchor = 'subtitleLabel.bottom';
881 else if (hasSubtitle) summaryTopAnchor = 'subtitleLabel.bottom';
890 else if (hasTitle) summaryTopAnchor = 'titleLabel.bottom';
882 else if (hasTitle) summaryTopAnchor = 'titleLabel.bottom';
891− else if (hasArt) summaryTopAnchor = 'artShapeHolder.bottom';
883+ else if (hasArt) summaryTopAnchor = 'artShapeLoader.bottom';
892 else summaryTopAnchor = 'parent.top';
884 else summaryTopAnchor = 'parent.top';
893
885
894 var summaryColor;
886 var summaryColor;
@@ -908,15 +900,15 @@ function cardString(template, components, isCardTool, artShapeStyle) {
908 var socialTopAnchor;
900 var socialTopAnchor;
909
901
910 if (hasSummary) socialTopAnchor = 'summary.bottom;';
902 if (hasSummary) socialTopAnchor = 'summary.bottom;';
911− else if (isHorizontal && hasArt) socialTopAnchor = 'artShapeHolder.bottom;';
903+ else if (isHorizontal && hasArt) socialTopAnchor = 'artShapeLoader.bottom;';
912− else if (headerAsOverlay && hasArt) socialTopAnchor = 'artShapeHolder.bottom;';
904+ else if (headerAsOverlay && hasArt) socialTopAnchor = 'artShapeLoader.bottom;';
913 else if (hasHeaderRow) socialTopAnchor = 'row.bottom;';
905 else if (hasHeaderRow) socialTopAnchor = 'row.bottom;';
914 else if (hasTitleContainer) socialTopAnchor = 'headerTitleContainer.bottom;';
906 else if (hasTitleContainer) socialTopAnchor = 'headerTitleContainer.bottom;';
915 else if (hasMascot) socialTopAnchor = 'mascotImage.bottom;';
907 else if (hasMascot) socialTopAnchor = 'mascotImage.bottom;';
916 else if (hasAttributes) socialTopAnchor = 'attributesRow.bottom;';
908 else if (hasAttributes) socialTopAnchor = 'attributesRow.bottom;';
917 else if (hasSubtitle) socialTopAnchor = 'subtitleLabel.bottom;';
909 else if (hasSubtitle) socialTopAnchor = 'subtitleLabel.bottom;';
918 else if (hasTitle) socialTopAnchor = 'titleLabel.bottom;';
910 else if (hasTitle) socialTopAnchor = 'titleLabel.bottom;';
919− else if (hasArt) socialTopAnchor = 'artShapeHolder.bottom;';
911+ else if (hasArt) socialTopAnchor = 'artShapeLoader.bottom;';
920 else socialTopAnchor = 'parent.top';
912 else socialTopAnchor = 'parent.top';
921
913
922 socialAnchors = 'top: ' + socialTopAnchor + ' left: parent.left; right: parent.right; topMargin: units.gu(1);'
914 socialAnchors = 'top: ' + socialTopAnchor + ' left: parent.left; right: parent.right; topMargin: units.gu(1);'
@@ -936,7 +928,7 @@ function cardString(template, components, isCardTool, artShapeStyle) {
936 if (hasBackground) {
928 if (hasBackground) {
937 touchdownAnchors = 'fill: backgroundLoader';
929 touchdownAnchors = 'fill: backgroundLoader';
938 } else if (touchdownOnArtShape) {
930 } else if (touchdownOnArtShape) {
939− touchdownAnchors = 'fill: artShapeHolder';
931+ touchdownAnchors = 'fill: artShapeLoader';
940 } else {
932 } else {
941 touchdownAnchors = 'fill: root'
933 touchdownAnchors = 'fill: root'
942 }
934 }
@@ -951,7 +943,7 @@ function cardString(template, components, isCardTool, artShapeStyle) {
951 } else if (isAudio) {
943 } else if (isAudio) {
952 implicitHeight += 'audioButton.height;\n';
944 implicitHeight += 'audioButton.height;\n';
953 } else if (headerAsOverlay) {
945 } else if (headerAsOverlay) {
954− implicitHeight += 'artShapeHolder.height;\n';
946+ implicitHeight += 'artShapeLoader.height;\n';
955 } else if (hasHeaderRow) {
947 } else if (hasHeaderRow) {
956 implicitHeight += 'row.y + row.height + units.gu(1);\n';
948 implicitHeight += 'row.y + row.height + units.gu(1);\n';
957 } else if (hasMascot) {
949 } else if (hasMascot) {
@@ -965,7 +957,7 @@ function cardString(template, components, isCardTool, artShapeStyle) {
965 } else if (hasTitle) {
957 } else if (hasTitle) {
966 implicitHeight += 'titleLabel.y + titleLabel.height + units.gu(1);\n';
958 implicitHeight += 'titleLabel.y + titleLabel.height + units.gu(1);\n';
967 } else if (hasArt) {
959 } else if (hasArt) {
968− implicitHeight += 'artShapeHolder.height;\n';
960+ implicitHeight += 'artShapeLoader.height;\n';
969 } else {
961 } else {
970 implicitHeight = '';
962 implicitHeight = '';
971 }
963 }
tests/plugins/Dash/cardcreator/1.res+8−11
@@ -12,23 +12,21 @@ AbstractButton {
12 property size fixedArtShapeSize: Qt.size(-1, -1);
12 property size fixedArtShapeSize: Qt.size(-1, -1);
13signal action(var actionId);
13signal action(var actionId);
14readonly property size artShapeSize: artShapeLoader.item ? Qt.size(artShapeLoader.item.width, artShapeLoader.item.height) : Qt.size(-1, -1);
14readonly property size artShapeSize: artShapeLoader.item ? Qt.size(artShapeLoader.item.width, artShapeLoader.item.height) : Qt.size(-1, -1);
15−Item {
16− id: artShapeHolder;
17− height: root.fixedArtShapeSize.height;
18− width: root.fixedArtShapeSize.width;
19− anchors { horizontalCenter: parent.horizontalCenter; }
20− Loader {
15+Loader {
21 id: artShapeLoader;
16 id: artShapeLoader;
17+ height: root.fixedArtShapeSize.height;
18+ width: root.fixedArtShapeSize.width;
19+ anchors { horizontalCenter: parent.horizontalCenter; }
22 objectName: "artShapeLoader";
20 objectName: "artShapeLoader";
23 readonly property string cardArt: cardData && cardData["art"] || "";
21 readonly property string cardArt: cardData && cardData["art"] || "";
24 onCardArtChanged: { if (item) { item.image.source = cardArt; } }
22 onCardArtChanged: { if (item) { item.image.source = cardArt; } }
25 active: cardArt != "";
23 active: cardArt != "";
26 asynchronous: true;
24 asynchronous: true;
27− visible: status == Loader.Ready;
25+ visible: status === Loader.Ready;
28 sourceComponent: Item {
26 sourceComponent: Item {
29 id: artShape;
27 id: artShape;
30 objectName: "artShape";
28 objectName: "artShape";
31− visible: image.status == Image.Ready;
29+ visible: image.status === Image.Ready;
32 readonly property alias image: artImage;
30 readonly property alias image: artImage;
33 UbuntuShape {
31 UbuntuShape {
34 anchors.fill: parent;
32 anchors.fill: parent;
@@ -50,14 +48,13 @@ Item {
50 }
48 }
51 }
49 }
52 }
50 }
53− }
54readonly property int headerHeight: titleLabel.height;
51readonly property int headerHeight: titleLabel.height;
55Label {
52Label {
56 id: titleLabel;
53 id: titleLabel;
57 objectName: "titleLabel";
54 objectName: "titleLabel";
58 anchors { right: parent.right;
55 anchors { right: parent.right;
59 left: parent.left;
56 left: parent.left;
60− top: artShapeHolder.bottom;
57+ top: artShapeLoader.bottom;
61 topMargin: units.gu(1);
58 topMargin: units.gu(1);
62 }
59 }
63 elide: Text.ElideRight;
60 elide: Text.ElideRight;
@@ -75,7 +72,7 @@ Label {
75UbuntuShape {
72UbuntuShape {
76 id: touchdown;
73 id: touchdown;
77 objectName: "touchdown";
74 objectName: "touchdown";
78− anchors { fill: artShapeHolder }
75+ anchors { fill: artShapeLoader }
79 visible: root.pressed;
76 visible: root.pressed;
80 radius: "medium";
77 radius: "medium";
81 borderSource: "radius_pressed.sci"
78 borderSource: "radius_pressed.sci"
tests/plugins/Dash/cardcreator/1.res.cardcreator+6−11
@@ -10,23 +10,19 @@ AbstractButton {
10 enabled: true;
10 enabled: true;
11signal action(var actionId);
11signal action(var actionId);
12readonly property size artShapeSize: artShapeLoader.item ? Qt.size(artShapeLoader.item.width, artShapeLoader.item.height) : Qt.size(-1, -1);
12readonly property size artShapeSize: artShapeLoader.item ? Qt.size(artShapeLoader.item.width, artShapeLoader.item.height) : Qt.size(-1, -1);
13−Item {
14− id: artShapeHolder;
15− height: artShapeLoader.height;
16− width: artShapeLoader.width;
17− anchors { horizontalCenter: parent.horizontalCenter; }
18− Loader {
13+Loader {
19 id: artShapeLoader;
14 id: artShapeLoader;
15+ anchors { horizontalCenter: parent.horizontalCenter; }
20 objectName: "artShapeLoader";
16 objectName: "artShapeLoader";
21 readonly property string cardArt: cardData && cardData["art"] || "";
17 readonly property string cardArt: cardData && cardData["art"] || "";
22 onCardArtChanged: { if (item) { item.image.source = cardArt; } }
18 onCardArtChanged: { if (item) { item.image.source = cardArt; } }
23 active: cardArt != "";
19 active: cardArt != "";
24 asynchronous: false;
20 asynchronous: false;
25− visible: status == Loader.Ready;
21+ visible: status === Loader.Ready;
26 sourceComponent: Item {
22 sourceComponent: Item {
27 id: artShape;
23 id: artShape;
28 objectName: "artShape";
24 objectName: "artShape";
29− visible: image.status == Image.Ready;
25+ visible: image.status === Image.Ready;
30 readonly property alias image: artImage;
26 readonly property alias image: artImage;
31 UbuntuShape {
27 UbuntuShape {
32 anchors.fill: parent;
28 anchors.fill: parent;
@@ -47,7 +43,6 @@ Item {
47 height: width / 1.6;
43 height: width / 1.6;
48 }
44 }
49 }
45 }
50− }
51 }
46 }
52readonly property int headerHeight: titleLabel.height;
47readonly property int headerHeight: titleLabel.height;
53Label {
48Label {
@@ -55,7 +50,7 @@ Label {
55 objectName: "titleLabel";
50 objectName: "titleLabel";
56 anchors { right: parent.right;
51 anchors { right: parent.right;
57 left: parent.left;
52 left: parent.left;
58− top: artShapeHolder.bottom;
53+ top: artShapeLoader.bottom;
59 topMargin: units.gu(1);
54 topMargin: units.gu(1);
60 }
55 }
61 elide: Text.ElideRight;
56 elide: Text.ElideRight;
@@ -73,7 +68,7 @@ Label {
73UbuntuShape {
68UbuntuShape {
74 id: touchdown;
69 id: touchdown;
75 objectName: "touchdown";
70 objectName: "touchdown";
76− anchors { fill: artShapeHolder }
71+ anchors { fill: artShapeLoader }
77 visible: root.pressed;
72 visible: root.pressed;
78 radius: "medium";
73 radius: "medium";
79 borderSource: "radius_pressed.sci"
74 borderSource: "radius_pressed.sci"
tests/plugins/Dash/cardcreator/10.res+1−1
@@ -16,7 +16,7 @@ Loader {
16 objectName: "backgroundLoader";
16 objectName: "backgroundLoader";
17 anchors.fill: parent;
17 anchors.fill: parent;
18 asynchronous: true;
18 asynchronous: true;
19− visible: status == Loader.Ready;
19+ visible: status === Loader.Ready;
20 sourceComponent: UbuntuShape {
20 sourceComponent: UbuntuShape {
21 objectName: "background";
21 objectName: "background";
22 radius: "medium";
22 radius: "medium";
tests/plugins/Dash/cardcreator/10.res.cardcreator+1−1
@@ -14,7 +14,7 @@ Loader {
14 objectName: "backgroundLoader";
14 objectName: "backgroundLoader";
15 anchors.fill: parent;
15 anchors.fill: parent;
16 asynchronous: false;
16 asynchronous: false;
17− visible: status == Loader.Ready;
17+ visible: status === Loader.Ready;
18 sourceComponent: UbuntuShape {
18 sourceComponent: UbuntuShape {
19 objectName: "background";
19 objectName: "background";
20 radius: "medium";
20 radius: "medium";
tests/plugins/Dash/cardcreator/11.res+9−12
@@ -16,7 +16,7 @@ Loader {
16 objectName: "backgroundLoader";
16 objectName: "backgroundLoader";
17 anchors.fill: parent;
17 anchors.fill: parent;
18 asynchronous: true;
18 asynchronous: true;
19− visible: status == Loader.Ready;
19+ visible: status === Loader.Ready;
20 sourceComponent: UbuntuShape {
20 sourceComponent: UbuntuShape {
21 objectName: "background";
21 objectName: "background";
22 radius: "medium";
22 radius: "medium";
@@ -50,23 +50,21 @@ Loader {
50 }
50 }
51 }
51 }
52readonly property size artShapeSize: artShapeLoader.item ? Qt.size(artShapeLoader.item.width, artShapeLoader.item.height) : Qt.size(-1, -1);
52readonly property size artShapeSize: artShapeLoader.item ? Qt.size(artShapeLoader.item.width, artShapeLoader.item.height) : Qt.size(-1, -1);
53−Item {
54− id: artShapeHolder;
55− height: root.fixedArtShapeSize.height;
56− width: root.fixedArtShapeSize.width;
57− anchors { horizontalCenter: parent.horizontalCenter; }
58− Loader {
53+Loader {
59 id: artShapeLoader;
54 id: artShapeLoader;
55+ height: root.fixedArtShapeSize.height;
56+ width: root.fixedArtShapeSize.width;
57+ anchors { horizontalCenter: parent.horizontalCenter; }
60 objectName: "artShapeLoader";
58 objectName: "artShapeLoader";
61 readonly property string cardArt: cardData && cardData["art"] || decodeURI("%5C");
59 readonly property string cardArt: cardData && cardData["art"] || decodeURI("%5C");
62 onCardArtChanged: { if (item) { item.image.source = cardArt; } }
60 onCardArtChanged: { if (item) { item.image.source = cardArt; } }
63 active: cardArt != "";
61 active: cardArt != "";
64 asynchronous: true;
62 asynchronous: true;
65− visible: status == Loader.Ready;
63+ visible: status === Loader.Ready;
66 sourceComponent: Item {
64 sourceComponent: Item {
67 id: artShape;
65 id: artShape;
68 objectName: "artShape";
66 objectName: "artShape";
69− visible: image.status == Image.Ready;
67+ visible: image.status === Image.Ready;
70 readonly property alias image: artImage;
68 readonly property alias image: artImage;
71 UbuntuShape {
69 UbuntuShape {
72 anchors.fill: parent;
70 anchors.fill: parent;
@@ -87,8 +85,7 @@ Item {
87 height: width / (root.fixedArtShapeSize.width / root.fixedArtShapeSize.height);
85 height: width / (root.fixedArtShapeSize.width / root.fixedArtShapeSize.height);
88 onStatusChanged: if (status === Image.Error) source = decodeURI("%5C");
86 onStatusChanged: if (status === Image.Error) source = decodeURI("%5C");
89 }
87 }
90− }
88+ }
91− }
92 }
89 }
93readonly property int headerHeight: row.height;
90readonly property int headerHeight: row.height;
94Row {
91Row {
@@ -97,7 +94,7 @@ Row {
97 property real margins: units.gu(1);
94 property real margins: units.gu(1);
98 spacing: margins;
95 spacing: margins;
99 height: root.fixedHeaderHeight;
96 height: root.fixedHeaderHeight;
100− anchors { top: artShapeHolder.bottom;
97+ anchors { top: artShapeLoader.bottom;
101 topMargin: units.gu(1);
98 topMargin: units.gu(1);
102left: parent.left;
99left: parent.left;
103 }
100 }
tests/plugins/Dash/cardcreator/11.res.cardcreator+6−11
@@ -14,7 +14,7 @@ Loader {
14 objectName: "backgroundLoader";
14 objectName: "backgroundLoader";
15 anchors.fill: parent;
15 anchors.fill: parent;
16 asynchronous: false;
16 asynchronous: false;
17− visible: status == Loader.Ready;
17+ visible: status === Loader.Ready;
18 sourceComponent: UbuntuShape {
18 sourceComponent: UbuntuShape {
19 objectName: "background";
19 objectName: "background";
20 radius: "medium";
20 radius: "medium";
@@ -48,23 +48,19 @@ Loader {
48 }
48 }
49 }
49 }
50readonly property size artShapeSize: artShapeLoader.item ? Qt.size(artShapeLoader.item.width, artShapeLoader.item.height) : Qt.size(-1, -1);
50readonly property size artShapeSize: artShapeLoader.item ? Qt.size(artShapeLoader.item.width, artShapeLoader.item.height) : Qt.size(-1, -1);
51−Item {
52− id: artShapeHolder;
53− height: artShapeLoader.height;
54− width: artShapeLoader.width;
55− anchors { horizontalCenter: parent.horizontalCenter; }
56− Loader {
51+Loader {
57 id: artShapeLoader;
52 id: artShapeLoader;
53+ anchors { horizontalCenter: parent.horizontalCenter; }
58 objectName: "artShapeLoader";
54 objectName: "artShapeLoader";
59 readonly property string cardArt: cardData && cardData["art"] || "";
55 readonly property string cardArt: cardData && cardData["art"] || "";
60 onCardArtChanged: { if (item) { item.image.source = cardArt; } }
56 onCardArtChanged: { if (item) { item.image.source = cardArt; } }
61 active: cardArt != "";
57 active: cardArt != "";
62 asynchronous: false;
58 asynchronous: false;
63− visible: status == Loader.Ready;
59+ visible: status === Loader.Ready;
64 sourceComponent: Item {
60 sourceComponent: Item {
65 id: artShape;
61 id: artShape;
66 objectName: "artShape";
62 objectName: "artShape";
67− visible: image.status == Image.Ready;
63+ visible: image.status === Image.Ready;
68 readonly property alias image: artImage;
64 readonly property alias image: artImage;
69 UbuntuShape {
65 UbuntuShape {
70 anchors.fill: parent;
66 anchors.fill: parent;
@@ -85,7 +81,6 @@ Item {
85 height: width / 1;
81 height: width / 1;
86 }
82 }
87 }
83 }
88− }
89 }
84 }
90readonly property int headerHeight: row.height;
85readonly property int headerHeight: row.height;
91Row {
86Row {
@@ -93,7 +88,7 @@ Row {
93 objectName: "outerRow";
88 objectName: "outerRow";
94 property real margins: units.gu(1);
89 property real margins: units.gu(1);
95 spacing: margins;
90 spacing: margins;
96− anchors { top: artShapeHolder.bottom;
91+ anchors { top: artShapeLoader.bottom;
97 topMargin: units.gu(1);
92 topMargin: units.gu(1);
98left: parent.left;
93left: parent.left;
99 }
94 }
tests/plugins/Dash/cardcreator/12.res+8−11
@@ -12,23 +12,21 @@ AbstractButton {
12 property size fixedArtShapeSize: Qt.size(-1, -1);
12 property size fixedArtShapeSize: Qt.size(-1, -1);
13signal action(var actionId);
13signal action(var actionId);
14readonly property size artShapeSize: artShapeLoader.item ? Qt.size(artShapeLoader.item.width, artShapeLoader.item.height) : Qt.size(-1, -1);
14readonly property size artShapeSize: artShapeLoader.item ? Qt.size(artShapeLoader.item.width, artShapeLoader.item.height) : Qt.size(-1, -1);
15−Item {
16− id: artShapeHolder;
17− height: root.fixedArtShapeSize.height;
18− width: root.fixedArtShapeSize.width;
19− anchors { horizontalCenter: parent.horizontalCenter; }
20− Loader {
15+Loader {
21 id: artShapeLoader;
16 id: artShapeLoader;
17+ height: root.fixedArtShapeSize.height;
18+ width: root.fixedArtShapeSize.width;
19+ anchors { horizontalCenter: parent.horizontalCenter; }
22 objectName: "artShapeLoader";
20 objectName: "artShapeLoader";
23 readonly property string cardArt: cardData && cardData["art"] || "";
21 readonly property string cardArt: cardData && cardData["art"] || "";
24 onCardArtChanged: { if (item) { item.image.source = cardArt; } }
22 onCardArtChanged: { if (item) { item.image.source = cardArt; } }
25 active: cardArt != "";
23 active: cardArt != "";
26 asynchronous: true;
24 asynchronous: true;
27− visible: status == Loader.Ready;
25+ visible: status === Loader.Ready;
28 sourceComponent: Item {
26 sourceComponent: Item {
29 id: artShape;
27 id: artShape;
30 objectName: "artShape";
28 objectName: "artShape";
31− visible: image.status == Image.Ready;
29+ visible: image.status === Image.Ready;
32 readonly property alias image: artImage;
30 readonly property alias image: artImage;
33 UbuntuShape {
31 UbuntuShape {
34 anchors.fill: parent;
32 anchors.fill: parent;
@@ -49,7 +47,6 @@ Item {
49 height: width / (root.fixedArtShapeSize.width / root.fixedArtShapeSize.height);
47 height: width / (root.fixedArtShapeSize.width / root.fixedArtShapeSize.height);
50 }
48 }
51 }
49 }
52− }
53 }
50 }
54readonly property int headerHeight: titleLabel.height + subtitleLabel.height + subtitleLabel.anchors.topMargin;
51readonly property int headerHeight: titleLabel.height + subtitleLabel.height + subtitleLabel.anchors.topMargin;
55Label {
52Label {
@@ -57,7 +54,7 @@ Label {
57 objectName: "titleLabel";
54 objectName: "titleLabel";
58 anchors { right: parent.right;
55 anchors { right: parent.right;
59 left: parent.left;
56 left: parent.left;
60− top: artShapeHolder.bottom;
57+ top: artShapeLoader.bottom;
61 topMargin: units.gu(1);
58 topMargin: units.gu(1);
62 }
59 }
63 elide: Text.ElideRight;
60 elide: Text.ElideRight;
@@ -101,7 +98,7 @@ CardSocialActions {
101UbuntuShape {
98UbuntuShape {
102 id: touchdown;
99 id: touchdown;
103 objectName: "touchdown";
100 objectName: "touchdown";
104− anchors { fill: artShapeHolder }
101+ anchors { fill: artShapeLoader }
105 visible: root.pressed;
102 visible: root.pressed;
106 radius: "medium";
103 radius: "medium";
107 borderSource: "radius_pressed.sci"
104 borderSource: "radius_pressed.sci"
tests/plugins/Dash/cardcreator/12.res.cardcreator+6−11
@@ -10,23 +10,19 @@ AbstractButton {
10 enabled: true;
10 enabled: true;
11signal action(var actionId);
11signal action(var actionId);
12readonly property size artShapeSize: artShapeLoader.item ? Qt.size(artShapeLoader.item.width, artShapeLoader.item.height) : Qt.size(-1, -1);
12readonly property size artShapeSize: artShapeLoader.item ? Qt.size(artShapeLoader.item.width, artShapeLoader.item.height) : Qt.size(-1, -1);
13−Item {
14− id: artShapeHolder;
15− height: artShapeLoader.height;
16− width: artShapeLoader.width;
17− anchors { horizontalCenter: parent.horizontalCenter; }
18− Loader {
13+Loader {
19 id: artShapeLoader;
14 id: artShapeLoader;
15+ anchors { horizontalCenter: parent.horizontalCenter; }
20 objectName: "artShapeLoader";
16 objectName: "artShapeLoader";
21 readonly property string cardArt: cardData && cardData["art"] || "";
17 readonly property string cardArt: cardData && cardData["art"] || "";
22 onCardArtChanged: { if (item) { item.image.source = cardArt; } }
18 onCardArtChanged: { if (item) { item.image.source = cardArt; } }
23 active: cardArt != "";
19 active: cardArt != "";
24 asynchronous: false;
20 asynchronous: false;
25− visible: status == Loader.Ready;
21+ visible: status === Loader.Ready;
26 sourceComponent: Item {
22 sourceComponent: Item {
27 id: artShape;
23 id: artShape;
28 objectName: "artShape";
24 objectName: "artShape";
29− visible: image.status == Image.Ready;
25+ visible: image.status === Image.Ready;
30 readonly property alias image: artImage;
26 readonly property alias image: artImage;
31 UbuntuShape {
27 UbuntuShape {
32 anchors.fill: parent;
28 anchors.fill: parent;
@@ -47,7 +43,6 @@ Item {
47 height: width / 0.75;
43 height: width / 0.75;
48 }
44 }
49 }
45 }
50− }
51 }
46 }
52readonly property int headerHeight: titleLabel.height + subtitleLabel.height + subtitleLabel.anchors.topMargin;
47readonly property int headerHeight: titleLabel.height + subtitleLabel.height + subtitleLabel.anchors.topMargin;
53Label {
48Label {
@@ -55,7 +50,7 @@ Label {
55 objectName: "titleLabel";
50 objectName: "titleLabel";
56 anchors { right: parent.right;
51 anchors { right: parent.right;
57 left: parent.left;
52 left: parent.left;
58− top: artShapeHolder.bottom;
53+ top: artShapeLoader.bottom;
59 topMargin: units.gu(1);
54 topMargin: units.gu(1);
60 }
55 }
61 elide: Text.ElideRight;
56 elide: Text.ElideRight;
@@ -99,7 +94,7 @@ CardSocialActions {
99UbuntuShape {
94UbuntuShape {
100 id: touchdown;
95 id: touchdown;
101 objectName: "touchdown";
96 objectName: "touchdown";
102− anchors { fill: artShapeHolder }
97+ anchors { fill: artShapeLoader }
103 visible: root.pressed;
98 visible: root.pressed;
104 radius: "medium";
99 radius: "medium";
105 borderSource: "radius_pressed.sci"
100 borderSource: "radius_pressed.sci"
tests/plugins/Dash/cardcreator/2.res+1−1
@@ -16,7 +16,7 @@ Loader {
16 objectName: "backgroundLoader";
16 objectName: "backgroundLoader";
17 anchors.fill: parent;
17 anchors.fill: parent;
18 asynchronous: true;
18 asynchronous: true;
19− visible: status == Loader.Ready;
19+ visible: status === Loader.Ready;
20 sourceComponent: UbuntuShape {
20 sourceComponent: UbuntuShape {
21 objectName: "background";
21 objectName: "background";
22 radius: "medium";
22 radius: "medium";
tests/plugins/Dash/cardcreator/2.res.cardcreator+1−1
@@ -14,7 +14,7 @@ Loader {
14 objectName: "backgroundLoader";
14 objectName: "backgroundLoader";
15 anchors.fill: parent;
15 anchors.fill: parent;
16 asynchronous: false;
16 asynchronous: false;
17− visible: status == Loader.Ready;
17+ visible: status === Loader.Ready;
18 sourceComponent: UbuntuShape {
18 sourceComponent: UbuntuShape {
19 objectName: "background";
19 objectName: "background";
20 radius: "medium";
20 radius: "medium";
tests/plugins/Dash/cardcreator/3.res+7−10
@@ -12,23 +12,21 @@ AbstractButton {
12 property size fixedArtShapeSize: Qt.size(-1, -1);
12 property size fixedArtShapeSize: Qt.size(-1, -1);
13signal action(var actionId);
13signal action(var actionId);
14readonly property size artShapeSize: artShapeLoader.item ? Qt.size(artShapeLoader.item.width, artShapeLoader.item.height) : Qt.size(-1, -1);
14readonly property size artShapeSize: artShapeLoader.item ? Qt.size(artShapeLoader.item.width, artShapeLoader.item.height) : Qt.size(-1, -1);
15−Item {
16− id: artShapeHolder;
17− height: root.fixedArtShapeSize.height;
18− width: root.fixedArtShapeSize.width;
19− anchors { horizontalCenter: parent.horizontalCenter; }
20− Loader {
15+Loader {
21 id: artShapeLoader;
16 id: artShapeLoader;
17+ height: root.fixedArtShapeSize.height;
18+ width: root.fixedArtShapeSize.width;
19+ anchors { horizontalCenter: parent.horizontalCenter; }
22 objectName: "artShapeLoader";
20 objectName: "artShapeLoader";
23 readonly property string cardArt: cardData && cardData["art"] || decodeURI("IHAVE%5C%22ESCAPED%5C%22QUOTES%5C%22");
21 readonly property string cardArt: cardData && cardData["art"] || decodeURI("IHAVE%5C%22ESCAPED%5C%22QUOTES%5C%22");
24 onCardArtChanged: { if (item) { item.image.source = cardArt; } }
22 onCardArtChanged: { if (item) { item.image.source = cardArt; } }
25 active: cardArt != "";
23 active: cardArt != "";
26 asynchronous: true;
24 asynchronous: true;
27− visible: status == Loader.Ready;
25+ visible: status === Loader.Ready;
28 sourceComponent: Item {
26 sourceComponent: Item {
29 id: artShape;
27 id: artShape;
30 objectName: "artShape";
28 objectName: "artShape";
31− visible: image.status == Image.Ready;
29+ visible: image.status === Image.Ready;
32 readonly property alias image: artImage;
30 readonly property alias image: artImage;
33 ProportionalShape {
31 ProportionalShape {
34 anchors.left: parent.left;
32 anchors.left: parent.left;
@@ -49,7 +47,6 @@ Item {
49 onStatusChanged: if (status === Image.Error) source = decodeURI("IHAVE%5C%22ESCAPED%5C%22QUOTES%5C%22");
47 onStatusChanged: if (status === Image.Error) source = decodeURI("IHAVE%5C%22ESCAPED%5C%22QUOTES%5C%22");
50 }
48 }
51 }
49 }
52− }
53 }
50 }
54readonly property int headerHeight: titleLabel.height + subtitleLabel.height + subtitleLabel.anchors.topMargin;
51readonly property int headerHeight: titleLabel.height + subtitleLabel.height + subtitleLabel.anchors.topMargin;
55Label {
52Label {
@@ -57,7 +54,7 @@ Label {
57 objectName: "titleLabel";
54 objectName: "titleLabel";
58 anchors { right: parent.right;
55 anchors { right: parent.right;
59 left: parent.left;
56 left: parent.left;
60− top: artShapeHolder.bottom;
57+ top: artShapeLoader.bottom;
61 topMargin: units.gu(1);
58 topMargin: units.gu(1);
62 }
59 }
63 elide: Text.ElideRight;
60 elide: Text.ElideRight;
tests/plugins/Dash/cardcreator/3.res.cardcreator+6−11
@@ -10,23 +10,19 @@ AbstractButton {
10 enabled: true;
10 enabled: true;
11signal action(var actionId);
11signal action(var actionId);
12readonly property size artShapeSize: artShapeLoader.item ? Qt.size(artShapeLoader.item.width, artShapeLoader.item.height) : Qt.size(-1, -1);
12readonly property size artShapeSize: artShapeLoader.item ? Qt.size(artShapeLoader.item.width, artShapeLoader.item.height) : Qt.size(-1, -1);
13−Item {
13+Loader {
14− id: artShapeHolder;
15− height: artShapeLoader.height;
16− width: artShapeLoader.width;
14+ id: artShapeLoader;
17− anchors { horizontalCenter: parent.horizontalCenter; }
15+ anchors { horizontalCenter: parent.horizontalCenter; }
18− Loader {
19− id: artShapeLoader;
20 objectName: "artShapeLoader";
16 objectName: "artShapeLoader";
21 readonly property string cardArt: cardData && cardData["art"] || "";
17 readonly property string cardArt: cardData && cardData["art"] || "";
22 onCardArtChanged: { if (item) { item.image.source = cardArt; } }
18 onCardArtChanged: { if (item) { item.image.source = cardArt; } }
23 active: cardArt != "";
19 active: cardArt != "";
24 asynchronous: false;
20 asynchronous: false;
25− visible: status == Loader.Ready;
21+ visible: status === Loader.Ready;
26 sourceComponent: Item {
22 sourceComponent: Item {
27 id: artShape;
23 id: artShape;
28 objectName: "artShape";
24 objectName: "artShape";
29− visible: image.status == Image.Ready;
25+ visible: image.status === Image.Ready;
30 readonly property alias image: artImage;
26 readonly property alias image: artImage;
31 ProportionalShape {
27 ProportionalShape {
32 anchors.left: parent.left;
28 anchors.left: parent.left;
@@ -46,7 +42,6 @@ Item {
46 height: width / 0.75;
42 height: width / 0.75;
47 }
43 }
48 }
44 }
49− }
50 }
45 }
51readonly property int headerHeight: titleLabel.height + subtitleLabel.height + subtitleLabel.anchors.topMargin;
46readonly property int headerHeight: titleLabel.height + subtitleLabel.height + subtitleLabel.anchors.topMargin;
52Label {
47Label {
@@ -54,7 +49,7 @@ Label {
54 objectName: "titleLabel";
49 objectName: "titleLabel";
55 anchors { right: parent.right;
50 anchors { right: parent.right;
56 left: parent.left;
51 left: parent.left;
57− top: artShapeHolder.bottom;
52+ top: artShapeLoader.bottom;
58 topMargin: units.gu(1);
53 topMargin: units.gu(1);
59 }
54 }
60 elide: Text.ElideRight;
55 elide: Text.ElideRight;
tests/plugins/Dash/cardcreator/4.res+1−1
@@ -32,7 +32,7 @@ Loader {
32 objectName: "mascotShapeLoader";
32 objectName: "mascotShapeLoader";
33 asynchronous: true;
33 asynchronous: true;
34 active: mascotImage.status === Image.Ready;
34 active: mascotImage.status === Image.Ready;
35− visible: showHeader && active && status == Loader.Ready;
35+ visible: showHeader && active && status === Loader.Ready;
36 width: units.gu(6);
36 width: units.gu(6);
37 height: units.gu(5.625);
37 height: units.gu(5.625);
38 sourceComponent: UbuntuShape { image: mascotImage }
38 sourceComponent: UbuntuShape { image: mascotImage }
tests/plugins/Dash/cardcreator/4.res.cardcreator+1−1
@@ -29,7 +29,7 @@ Loader {
29 objectName: "mascotShapeLoader";
29 objectName: "mascotShapeLoader";
30 asynchronous: false;
30 asynchronous: false;
31 active: mascotImage.status === Image.Ready;
31 active: mascotImage.status === Image.Ready;
32− visible: showHeader && active && status == Loader.Ready;
32+ visible: showHeader && active && status === Loader.Ready;
33 width: units.gu(6);
33 width: units.gu(6);
34 height: units.gu(5.625);
34 height: units.gu(5.625);
35 sourceComponent: UbuntuShape { image: mascotImage }
35 sourceComponent: UbuntuShape { image: mascotImage }
tests/plugins/Dash/cardcreator/5.res+9−12
@@ -12,23 +12,21 @@ AbstractButton {
12 property size fixedArtShapeSize: Qt.size(-1, -1);
12 property size fixedArtShapeSize: Qt.size(-1, -1);
13signal action(var actionId);
13signal action(var actionId);
14readonly property size artShapeSize: artShapeLoader.item ? Qt.size(artShapeLoader.item.width, artShapeLoader.item.height) : Qt.size(-1, -1);
14readonly property size artShapeSize: artShapeLoader.item ? Qt.size(artShapeLoader.item.width, artShapeLoader.item.height) : Qt.size(-1, -1);
15−Item {
16− id: artShapeHolder;
17− height: root.fixedArtShapeSize.height;
18− width: root.fixedArtShapeSize.width;
19− anchors { horizontalCenter: parent.horizontalCenter; }
20− Loader {
15+Loader {
21 id: artShapeLoader;
16 id: artShapeLoader;
17+ height: root.fixedArtShapeSize.height;
18+ width: root.fixedArtShapeSize.width;
19+ anchors { horizontalCenter: parent.horizontalCenter; }
22 objectName: "artShapeLoader";
20 objectName: "artShapeLoader";
23 readonly property string cardArt: cardData && cardData["art"] || "";
21 readonly property string cardArt: cardData && cardData["art"] || "";
24 onCardArtChanged: { if (item) { item.image.source = cardArt; } }
22 onCardArtChanged: { if (item) { item.image.source = cardArt; } }
25 active: cardArt != "";
23 active: cardArt != "";
26 asynchronous: true;
24 asynchronous: true;
27− visible: status == Loader.Ready;
25+ visible: status === Loader.Ready;
28 sourceComponent: Item {
26 sourceComponent: Item {
29 id: artShape;
27 id: artShape;
30 objectName: "artShape";
28 objectName: "artShape";
31− visible: image.status == Image.Ready;
29+ visible: image.status === Image.Ready;
32 readonly property alias image: artImage;
30 readonly property alias image: artImage;
33 width: root.fixedArtShapeSize.width;
31 width: root.fixedArtShapeSize.width;
34 height: root.fixedArtShapeSize.height;
32 height: root.fixedArtShapeSize.height;
@@ -42,15 +40,14 @@ Item {
42 height: width / (root.fixedArtShapeSize.width / root.fixedArtShapeSize.height);
40 height: width / (root.fixedArtShapeSize.width / root.fixedArtShapeSize.height);
43 }
41 }
44 }
42 }
45− }
46 }
43 }
47Loader {
44Loader {
48 id: overlayLoader;
45 id: overlayLoader;
49 readonly property real overlayHeight: root.fixedHeaderHeight + units.gu(2);
46 readonly property real overlayHeight: root.fixedHeaderHeight + units.gu(2);
50− anchors.fill: artShapeHolder;
47+ anchors.fill: artShapeLoader;
51 active: artShapeLoader.active && artShapeLoader.item && artShapeLoader.item.image.status === Image.Ready || false;
48 active: artShapeLoader.active && artShapeLoader.item && artShapeLoader.item.image.status === Image.Ready || false;
52 asynchronous: true;
49 asynchronous: true;
53− visible: showHeader && status == Loader.Ready;
50+ visible: showHeader && status === Loader.Ready;
54 sourceComponent: UbuntuShapeOverlay {
51 sourceComponent: UbuntuShapeOverlay {
55 id: overlay;
52 id: overlay;
56 property real luminance: Style.luminance(overlayColor);
53 property real luminance: Style.luminance(overlayColor);
@@ -102,5 +99,5 @@ Label {
102 text: cardData && cardData["subtitle"] || "";
99 text: cardData && cardData["subtitle"] || "";
103 font.weight: Font.Light;
100 font.weight: Font.Light;
104 }
101 }
105−implicitHeight: artShapeHolder.height;
102+implicitHeight: artShapeLoader.height;
106}
103}
tests/plugins/Dash/cardcreator/5.res.cardcreator+7−12
@@ -10,23 +10,19 @@ AbstractButton {
10 enabled: false;
10 enabled: false;
11signal action(var actionId);
11signal action(var actionId);
12readonly property size artShapeSize: artShapeLoader.item ? Qt.size(artShapeLoader.item.width, artShapeLoader.item.height) : Qt.size(-1, -1);
12readonly property size artShapeSize: artShapeLoader.item ? Qt.size(artShapeLoader.item.width, artShapeLoader.item.height) : Qt.size(-1, -1);
13−Item {
14− id: artShapeHolder;
15− height: artShapeLoader.height;
16− width: artShapeLoader.width;
17− anchors { horizontalCenter: parent.horizontalCenter; }
18− Loader {
13+Loader {
19 id: artShapeLoader;
14 id: artShapeLoader;
15+ anchors { horizontalCenter: parent.horizontalCenter; }
20 objectName: "artShapeLoader";
16 objectName: "artShapeLoader";
21 readonly property string cardArt: cardData && cardData["art"] || "";
17 readonly property string cardArt: cardData && cardData["art"] || "";
22 onCardArtChanged: { if (item) { item.image.source = cardArt; } }
18 onCardArtChanged: { if (item) { item.image.source = cardArt; } }
23 active: cardArt != "";
19 active: cardArt != "";
24 asynchronous: false;
20 asynchronous: false;
25− visible: status == Loader.Ready;
21+ visible: status === Loader.Ready;
26 sourceComponent: Item {
22 sourceComponent: Item {
27 id: artShape;
23 id: artShape;
28 objectName: "artShape";
24 objectName: "artShape";
29− visible: image.status == Image.Ready;
25+ visible: image.status === Image.Ready;
30 readonly property alias image: artImage;
26 readonly property alias image: artImage;
31 width: image.status !== Image.Ready ? 0 : image.width;
27 width: image.status !== Image.Ready ? 0 : image.width;
32 height: image.status !== Image.Ready ? 0 : image.height;
28 height: image.status !== Image.Ready ? 0 : image.height;
@@ -40,15 +36,14 @@ Item {
40 height: width / 1;
36 height: width / 1;
41 }
37 }
42 }
38 }
43− }
44 }
39 }
45Loader {
40Loader {
46 id: overlayLoader;
41 id: overlayLoader;
47 readonly property real overlayHeight: headerHeight + units.gu(2);
42 readonly property real overlayHeight: headerHeight + units.gu(2);
48− anchors.fill: artShapeHolder;
43+ anchors.fill: artShapeLoader;
49 active: artShapeLoader.active && artShapeLoader.item && artShapeLoader.item.image.status === Image.Ready || false;
44 active: artShapeLoader.active && artShapeLoader.item && artShapeLoader.item.image.status === Image.Ready || false;
50 asynchronous: false;
45 asynchronous: false;
51− visible: showHeader && status == Loader.Ready;
46+ visible: showHeader && status === Loader.Ready;
52 sourceComponent: UbuntuShapeOverlay {
47 sourceComponent: UbuntuShapeOverlay {
53 id: overlay;
48 id: overlay;
54 property real luminance: Style.luminance(overlayColor);
49 property real luminance: Style.luminance(overlayColor);
@@ -100,5 +95,5 @@ Label {
100 text: cardData && cardData["subtitle"] || "";
95 text: cardData && cardData["subtitle"] || "";
101 font.weight: Font.Light;
96 font.weight: Font.Light;
102 }
97 }
103−implicitHeight: artShapeHolder.height;
98+implicitHeight: artShapeLoader.height;
104}
99}
tests/plugins/Dash/cardcreator/6.res+1−1
@@ -16,7 +16,7 @@ Loader {
16 objectName: "backgroundLoader";
16 objectName: "backgroundLoader";
17 anchors.fill: parent;
17 anchors.fill: parent;
18 asynchronous: true;
18 asynchronous: true;
19− visible: status == Loader.Ready;
19+ visible: status === Loader.Ready;
20 sourceComponent: UbuntuShape {
20 sourceComponent: UbuntuShape {
21 objectName: "background";
21 objectName: "background";
22 radius: "medium";
22 radius: "medium";
tests/plugins/Dash/cardcreator/6.res.cardcreator+1−1
@@ -14,7 +14,7 @@ Loader {
14 objectName: "backgroundLoader";
14 objectName: "backgroundLoader";
15 anchors.fill: parent;
15 anchors.fill: parent;
16 asynchronous: false;
16 asynchronous: false;
17− visible: status == Loader.Ready;
17+ visible: status === Loader.Ready;
18 sourceComponent: UbuntuShape {
18 sourceComponent: UbuntuShape {
19 objectName: "background";
19 objectName: "background";
20 radius: "medium";
20 radius: "medium";
tests/plugins/Dash/cardcreator/7.res+1−1
@@ -16,7 +16,7 @@ Loader {
16 objectName: "backgroundLoader";
16 objectName: "backgroundLoader";
17 anchors.fill: parent;
17 anchors.fill: parent;
18 asynchronous: true;
18 asynchronous: true;
19− visible: status == Loader.Ready;
19+ visible: status === Loader.Ready;
20 sourceComponent: UbuntuShape {
20 sourceComponent: UbuntuShape {
21 objectName: "background";
21 objectName: "background";
22 radius: "medium";
22 radius: "medium";
tests/plugins/Dash/cardcreator/7.res.cardcreator+1−1
@@ -14,7 +14,7 @@ Loader {
14 objectName: "backgroundLoader";
14 objectName: "backgroundLoader";
15 anchors.fill: parent;
15 anchors.fill: parent;
16 asynchronous: false;
16 asynchronous: false;
17− visible: status == Loader.Ready;
17+ visible: status === Loader.Ready;
18 sourceComponent: UbuntuShape {
18 sourceComponent: UbuntuShape {
19 objectName: "background";
19 objectName: "background";
20 radius: "medium";
20 radius: "medium";
tests/plugins/Dash/cardcreator/8.res+1−1
@@ -16,7 +16,7 @@ Loader {
16 objectName: "backgroundLoader";
16 objectName: "backgroundLoader";
17 anchors.fill: parent;
17 anchors.fill: parent;
18 asynchronous: true;
18 asynchronous: true;
19− visible: status == Loader.Ready;
19+ visible: status === Loader.Ready;
20 sourceComponent: UbuntuShape {
20 sourceComponent: UbuntuShape {
21 objectName: "background";
21 objectName: "background";
22 radius: "medium";
22 radius: "medium";
tests/plugins/Dash/cardcreator/8.res.cardcreator+1−1
@@ -14,7 +14,7 @@ Loader {
14 objectName: "backgroundLoader";
14 objectName: "backgroundLoader";
15 anchors.fill: parent;
15 anchors.fill: parent;
16 asynchronous: false;
16 asynchronous: false;
17− visible: status == Loader.Ready;
17+ visible: status === Loader.Ready;
18 sourceComponent: UbuntuShape {
18 sourceComponent: UbuntuShape {
19 objectName: "background";
19 objectName: "background";
20 radius: "medium";
20 radius: "medium";