on xenial help sign in
CardCreator: Remove ShaderEffectSource
b7c493aAlbert Astals Cid
plugins/Dash/CardCreator.js+4−11
@@ -62,7 +62,7 @@ var kBackgroundLoaderCode = 'Loader {\n\
62// %1 is used as anchors of artShapeHolder
62// %1 is used as anchors of artShapeHolder
63// %2 is used as image width
63// %2 is used as image width
64// %3 is used as image height
64// %3 is used as image height
65−// %4 is used for artShapeSource.hideSource and inner Loader visible
65+// %4 is whether the image or the Loader with the UbuntuShape/ProportionalShape should be visible
66// %5 is used as aspect ratio fallback
66// %5 is used as aspect ratio fallback
67// %6 is whether the loader should be asynchronous or not
67// %6 is whether the loader should be asynchronous or not
68// %7 is injected as code to artImage
68// %7 is injected as code to artImage
@@ -84,14 +84,6 @@ var kArtShapeHolderCode = 'Item { \n\
84 objectName: "artShape"; \n\
84 objectName: "artShape"; \n\
85 visible: image.status == Image.Ready; \n\
85 visible: image.status == Image.Ready; \n\
86 readonly property alias image: artImage; \n\
86 readonly property alias image: artImage; \n\
87− ShaderEffectSource { \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\
87 Loader { \n\
96 anchors.fill: parent; \n\
88 anchors.fill: parent; \n\
97 visible: %4; \n\
89 visible: %4; \n\
@@ -99,7 +91,7 @@ var kArtShapeHolderCode = 'Item { \n\
99 Component { \n\
91 Component { \n\
100 id: artShapeShapeComponent; \n\
92 id: artShapeShapeComponent; \n\
101 UbuntuShape { \n\
93 UbuntuShape { \n\
102− source: artShapeSource; \n\
94+ source: artImage; \n\
103 sourceFillMode: UbuntuShape.PreserveAspectCrop; \n\
95 sourceFillMode: UbuntuShape.PreserveAspectCrop; \n\
104 radius: "medium"; \n\
96 radius: "medium"; \n\
105 aspect: { \n\
97 aspect: { \n\
@@ -114,7 +106,7 @@ var kArtShapeHolderCode = 'Item { \n\
114 } \n\
106 } \n\
115 Component { \n\
107 Component { \n\
116 id: artShapeIconComponent; \n\
108 id: artShapeIconComponent; \n\
117− ProportionalShape { source: artShapeSource; aspect: UbuntuShape.DropShadow; } \n\
109+ ProportionalShape { source: artImage; aspect: UbuntuShape.DropShadow; } \n\
118 } \n\
110 } \n\
119 } \n\
111 } \n\
120 readonly property real fixedArtShapeSizeAspect: (root.fixedArtShapeSize.height > 0 && root.fixedArtShapeSize.width > 0) ? root.fixedArtShapeSize.width / root.fixedArtShapeSize.height : -1; \n\
112 readonly property real fixedArtShapeSizeAspect: (root.fixedArtShapeSize.height > 0 && root.fixedArtShapeSize.width > 0) ? root.fixedArtShapeSize.width / root.fixedArtShapeSize.height : -1; \n\
@@ -135,6 +127,7 @@ var kArtShapeHolderCode = 'Item { \n\
135 objectName: "artImage"; \n\
127 objectName: "artImage"; \n\
136 source: artShapeLoader.cardArt; \n\
128 source: artShapeLoader.cardArt; \n\
137 asynchronous: %6; \n\
129 asynchronous: %6; \n\
130+ visible: !%4; \n\
138 width: %2; \n\
131 width: %2; \n\
139 height: %3; \n\
132 height: %3; \n\
140 %7 \n\
133 %7 \n\
tests/plugins/Dash/cardcreator/1.res+4−11
@@ -30,14 +30,6 @@ Item {
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: true;
40− }
41 Loader {
33 Loader {
42 anchors.fill: parent;
34 anchors.fill: parent;
43 visible: true;
35 visible: true;
@@ -45,7 +37,7 @@ Item {
45 Component {
37 Component {
46 id: artShapeShapeComponent;
38 id: artShapeShapeComponent;
47 UbuntuShape {
39 UbuntuShape {
48− source: artShapeSource;
40+ source: artImage;
49 sourceFillMode: UbuntuShape.PreserveAspectCrop;
41 sourceFillMode: UbuntuShape.PreserveAspectCrop;
50 radius: "medium";
42 radius: "medium";
51 aspect: {
43 aspect: {
@@ -60,7 +52,7 @@ Item {
60 }
52 }
61 Component {
53 Component {
62 id: artShapeIconComponent;
54 id: artShapeIconComponent;
63− ProportionalShape { source: artShapeSource; aspect: UbuntuShape.DropShadow; }
55+ ProportionalShape { source: artImage; aspect: UbuntuShape.DropShadow; }
64 }
56 }
65 }
57 }
66 readonly property real fixedArtShapeSizeAspect: (root.fixedArtShapeSize.height > 0 && root.fixedArtShapeSize.width > 0) ? root.fixedArtShapeSize.width / root.fixedArtShapeSize.height : -1;
58 readonly property real fixedArtShapeSizeAspect: (root.fixedArtShapeSize.height > 0 && root.fixedArtShapeSize.width > 0) ? root.fixedArtShapeSize.width / root.fixedArtShapeSize.height : -1;
@@ -81,7 +73,8 @@ Item {
81 objectName: "artImage";
73 objectName: "artImage";
82 source: artShapeLoader.cardArt;
74 source: artShapeLoader.cardArt;
83 asynchronous: true;
75 asynchronous: true;
76+ visible: !true;
84− width: root.width;
77+ width: root.width;
85 height: width / artShape.aspect;
78 height: width / artShape.aspect;
86 }
79 }
87 }
80 }
tests/plugins/Dash/cardcreator/1.res.cardcreator+3−10
@@ -29,14 +29,6 @@ Item {
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: true;
39− }
40 Loader {
32 Loader {
41 anchors.fill: parent;
33 anchors.fill: parent;
42 visible: true;
34 visible: true;
@@ -44,7 +36,7 @@ Item {
44 Component {
36 Component {
45 id: artShapeShapeComponent;
37 id: artShapeShapeComponent;
46 UbuntuShape {
38 UbuntuShape {
47− source: artShapeSource;
39+ source: artImage;
48 sourceFillMode: UbuntuShape.PreserveAspectCrop;
40 sourceFillMode: UbuntuShape.PreserveAspectCrop;
49 radius: "medium";
41 radius: "medium";
50 aspect: {
42 aspect: {
@@ -59,7 +51,7 @@ Item {
59 }
51 }
60 Component {
52 Component {
61 id: artShapeIconComponent;
53 id: artShapeIconComponent;
62− ProportionalShape { source: artShapeSource; aspect: UbuntuShape.DropShadow; }
54+ ProportionalShape { source: artImage; aspect: UbuntuShape.DropShadow; }
63 }
55 }
64 }
56 }
65 readonly property real fixedArtShapeSizeAspect: (root.fixedArtShapeSize.height > 0 && root.fixedArtShapeSize.width > 0) ? root.fixedArtShapeSize.width / root.fixedArtShapeSize.height : -1;
57 readonly property real fixedArtShapeSizeAspect: (root.fixedArtShapeSize.height > 0 && root.fixedArtShapeSize.width > 0) ? root.fixedArtShapeSize.width / root.fixedArtShapeSize.height : -1;
@@ -80,6 +72,7 @@ Item {
80 objectName: "artImage";
72 objectName: "artImage";
81 source: artShapeLoader.cardArt;
73 source: artShapeLoader.cardArt;
82 asynchronous: false;
74 asynchronous: false;
75+ visible: !true;
83 width: root.width;
76 width: root.width;
84 height: width / artShape.aspect;
77 height: width / artShape.aspect;
85 }
78 }
tests/plugins/Dash/cardcreator/11.res+3−10
@@ -68,14 +68,6 @@ Item {
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 {
72− id: artShapeSource;
73− sourceItem: artImage;
74− anchors.centerIn: parent;
75− width: 1;
76− height: 1;
77− hideSource: true;
78− }
79 Loader {
71 Loader {
80 anchors.fill: parent;
72 anchors.fill: parent;
81 visible: true;
73 visible: true;
@@ -83,7 +75,7 @@ Item {
83 Component {
75 Component {
84 id: artShapeShapeComponent;
76 id: artShapeShapeComponent;
85 UbuntuShape {
77 UbuntuShape {
86− source: artShapeSource;
78+ source: artImage;
87 sourceFillMode: UbuntuShape.PreserveAspectCrop;
79 sourceFillMode: UbuntuShape.PreserveAspectCrop;
88 radius: "medium";
80 radius: "medium";
89 aspect: {
81 aspect: {
@@ -98,7 +90,7 @@ Item {
98 }
90 }
99 Component {
91 Component {
100 id: artShapeIconComponent;
92 id: artShapeIconComponent;
101− ProportionalShape { source: artShapeSource; aspect: UbuntuShape.DropShadow; }
93+ ProportionalShape { source: artImage; aspect: UbuntuShape.DropShadow; }
102 }
94 }
103 }
95 }
104 readonly property real fixedArtShapeSizeAspect: (root.fixedArtShapeSize.height > 0 && root.fixedArtShapeSize.width > 0) ? root.fixedArtShapeSize.width / root.fixedArtShapeSize.height : -1;
96 readonly property real fixedArtShapeSizeAspect: (root.fixedArtShapeSize.height > 0 && root.fixedArtShapeSize.width > 0) ? root.fixedArtShapeSize.width / root.fixedArtShapeSize.height : -1;
@@ -119,6 +111,7 @@ Item {
119 objectName: "artImage";
111 objectName: "artImage";
120 source: artShapeLoader.cardArt;
112 source: artShapeLoader.cardArt;
121 asynchronous: true;
113 asynchronous: true;
114+ visible: !true;
122 width: root.width;
115 width: root.width;
123 height: width / artShape.aspect;
116 height: width / artShape.aspect;
124 onStatusChanged: if (status === Image.Error) source = decodeURI("%5C");
117 onStatusChanged: if (status === Image.Error) source = decodeURI("%5C");
tests/plugins/Dash/cardcreator/11.res.cardcreator+3−10
@@ -67,14 +67,6 @@ Item {
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 {
71− id: artShapeSource;
72− sourceItem: artImage;
73− anchors.centerIn: parent;
74− width: 1;
75− height: 1;
76− hideSource: true;
77− }
78 Loader {
70 Loader {
79 anchors.fill: parent;
71 anchors.fill: parent;
80 visible: true;
72 visible: true;
@@ -82,7 +74,7 @@ Item {
82 Component {
74 Component {
83 id: artShapeShapeComponent;
75 id: artShapeShapeComponent;
84 UbuntuShape {
76 UbuntuShape {
85− source: artShapeSource;
77+ source: artImage;
86 sourceFillMode: UbuntuShape.PreserveAspectCrop;
78 sourceFillMode: UbuntuShape.PreserveAspectCrop;
87 radius: "medium";
79 radius: "medium";
88 aspect: {
80 aspect: {
@@ -97,7 +89,7 @@ Item {
97 }
89 }
98 Component {
90 Component {
99 id: artShapeIconComponent;
91 id: artShapeIconComponent;
100− ProportionalShape { source: artShapeSource; aspect: UbuntuShape.DropShadow; }
92+ ProportionalShape { source: artImage; aspect: UbuntuShape.DropShadow; }
101 }
93 }
102 }
94 }
103 readonly property real fixedArtShapeSizeAspect: (root.fixedArtShapeSize.height > 0 && root.fixedArtShapeSize.width > 0) ? root.fixedArtShapeSize.width / root.fixedArtShapeSize.height : -1;
95 readonly property real fixedArtShapeSizeAspect: (root.fixedArtShapeSize.height > 0 && root.fixedArtShapeSize.width > 0) ? root.fixedArtShapeSize.width / root.fixedArtShapeSize.height : -1;
@@ -118,6 +110,7 @@ Item {
118 objectName: "artImage";
110 objectName: "artImage";
119 source: artShapeLoader.cardArt;
111 source: artShapeLoader.cardArt;
120 asynchronous: false;
112 asynchronous: false;
113+ visible: !true;
121 width: root.width;
114 width: root.width;
122 height: width / artShape.aspect;
115 height: width / artShape.aspect;
123 }
116 }
tests/plugins/Dash/cardcreator/3.res+3−10
@@ -30,14 +30,6 @@ Item {
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: true;
40− }
41 Loader {
33 Loader {
42 anchors.fill: parent;
34 anchors.fill: parent;
43 visible: true;
35 visible: true;
@@ -45,7 +37,7 @@ Item {
45 Component {
37 Component {
46 id: artShapeShapeComponent;
38 id: artShapeShapeComponent;
47 UbuntuShape {
39 UbuntuShape {
48− source: artShapeSource;
40+ source: artImage;
49 sourceFillMode: UbuntuShape.PreserveAspectCrop;
41 sourceFillMode: UbuntuShape.PreserveAspectCrop;
50 radius: "medium";
42 radius: "medium";
51 aspect: {
43 aspect: {
@@ -60,7 +52,7 @@ Item {
60 }
52 }
61 Component {
53 Component {
62 id: artShapeIconComponent;
54 id: artShapeIconComponent;
63− ProportionalShape { source: artShapeSource; aspect: UbuntuShape.DropShadow; }
55+ ProportionalShape { source: artImage; aspect: UbuntuShape.DropShadow; }
64 }
56 }
65 }
57 }
66 readonly property real fixedArtShapeSizeAspect: (root.fixedArtShapeSize.height > 0 && root.fixedArtShapeSize.width > 0) ? root.fixedArtShapeSize.width / root.fixedArtShapeSize.height : -1;
58 readonly property real fixedArtShapeSizeAspect: (root.fixedArtShapeSize.height > 0 && root.fixedArtShapeSize.width > 0) ? root.fixedArtShapeSize.width / root.fixedArtShapeSize.height : -1;
@@ -81,6 +73,7 @@ Item {
81 objectName: "artImage";
73 objectName: "artImage";
82 source: artShapeLoader.cardArt;
74 source: artShapeLoader.cardArt;
83 asynchronous: true;
75 asynchronous: true;
76+ visible: !true;
84 width: root.width;
77 width: root.width;
85 height: width / artShape.aspect;
78 height: width / artShape.aspect;
86 onStatusChanged: if (status === Image.Error) source = decodeURI("IHAVE%5C%22ESCAPED%5C%22QUOTES%5C%22");
79 onStatusChanged: if (status === Image.Error) source = decodeURI("IHAVE%5C%22ESCAPED%5C%22QUOTES%5C%22");
tests/plugins/Dash/cardcreator/3.res.cardcreator+3−10
@@ -29,14 +29,6 @@ Item {
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: true;
39− }
40 Loader {
32 Loader {
41 anchors.fill: parent;
33 anchors.fill: parent;
42 visible: true;
34 visible: true;
@@ -44,7 +36,7 @@ Item {
44 Component {
36 Component {
45 id: artShapeShapeComponent;
37 id: artShapeShapeComponent;
46 UbuntuShape {
38 UbuntuShape {
47− source: artShapeSource;
39+ source: artImage;
48 sourceFillMode: UbuntuShape.PreserveAspectCrop;
40 sourceFillMode: UbuntuShape.PreserveAspectCrop;
49 radius: "medium";
41 radius: "medium";
50 aspect: {
42 aspect: {
@@ -59,7 +51,7 @@ Item {
59 }
51 }
60 Component {
52 Component {
61 id: artShapeIconComponent;
53 id: artShapeIconComponent;
62− ProportionalShape { source: artShapeSource; aspect: UbuntuShape.DropShadow; }
54+ ProportionalShape { source: artImage; aspect: UbuntuShape.DropShadow; }
63 }
55 }
64 }
56 }
65 readonly property real fixedArtShapeSizeAspect: (root.fixedArtShapeSize.height > 0 && root.fixedArtShapeSize.width > 0) ? root.fixedArtShapeSize.width / root.fixedArtShapeSize.height : -1;
57 readonly property real fixedArtShapeSizeAspect: (root.fixedArtShapeSize.height > 0 && root.fixedArtShapeSize.width > 0) ? root.fixedArtShapeSize.width / root.fixedArtShapeSize.height : -1;
@@ -80,6 +72,7 @@ Item {
80 objectName: "artImage";
72 objectName: "artImage";
81 source: artShapeLoader.cardArt;
73 source: artShapeLoader.cardArt;
82 asynchronous: false;
74 asynchronous: false;
75+ visible: !true;
83 width: root.width;
76 width: root.width;
84 height: width / artShape.aspect;
77 height: width / artShape.aspect;
85 }
78 }
tests/plugins/Dash/cardcreator/5.res+3−10
@@ -30,14 +30,6 @@ Item {
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 {
33 Loader {
42 anchors.fill: parent;
34 anchors.fill: parent;
43 visible: false;
35 visible: false;
@@ -45,7 +37,7 @@ Item {
45 Component {
37 Component {
46 id: artShapeShapeComponent;
38 id: artShapeShapeComponent;
47 UbuntuShape {
39 UbuntuShape {
48− source: artShapeSource;
40+ source: artImage;
49 sourceFillMode: UbuntuShape.PreserveAspectCrop;
41 sourceFillMode: UbuntuShape.PreserveAspectCrop;
50 radius: "medium";
42 radius: "medium";
51 aspect: {
43 aspect: {
@@ -60,7 +52,7 @@ Item {
60 }
52 }
61 Component {
53 Component {
62 id: artShapeIconComponent;
54 id: artShapeIconComponent;
63− ProportionalShape { source: artShapeSource; aspect: UbuntuShape.DropShadow; }
55+ ProportionalShape { source: artImage; aspect: UbuntuShape.DropShadow; }
64 }
56 }
65 }
57 }
66 readonly property real fixedArtShapeSizeAspect: (root.fixedArtShapeSize.height > 0 && root.fixedArtShapeSize.width > 0) ? root.fixedArtShapeSize.width / root.fixedArtShapeSize.height : -1;
58 readonly property real fixedArtShapeSizeAspect: (root.fixedArtShapeSize.height > 0 && root.fixedArtShapeSize.width > 0) ? root.fixedArtShapeSize.width / root.fixedArtShapeSize.height : -1;
@@ -81,6 +73,7 @@ Item {
81 objectName: "artImage";
73 objectName: "artImage";
82 source: artShapeLoader.cardArt;
74 source: artShapeLoader.cardArt;
83 asynchronous: true;
75 asynchronous: true;
76+ visible: !false;
84 width: root.width;
77 width: root.width;
85 height: width / artShape.aspect;
78 height: width / artShape.aspect;
86 }
79 }
tests/plugins/Dash/cardcreator/5.res.cardcreator+3−10
@@ -29,14 +29,6 @@ Item {
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 {
32 Loader {
41 anchors.fill: parent;
33 anchors.fill: parent;
42 visible: false;
34 visible: false;
@@ -44,7 +36,7 @@ Item {
44 Component {
36 Component {
45 id: artShapeShapeComponent;
37 id: artShapeShapeComponent;
46 UbuntuShape {
38 UbuntuShape {
47− source: artShapeSource;
39+ source: artImage;
48 sourceFillMode: UbuntuShape.PreserveAspectCrop;
40 sourceFillMode: UbuntuShape.PreserveAspectCrop;
49 radius: "medium";
41 radius: "medium";
50 aspect: {
42 aspect: {
@@ -59,7 +51,7 @@ Item {
59 }
51 }
60 Component {
52 Component {
61 id: artShapeIconComponent;
53 id: artShapeIconComponent;
62− ProportionalShape { source: artShapeSource; aspect: UbuntuShape.DropShadow; }
54+ ProportionalShape { source: artImage; aspect: UbuntuShape.DropShadow; }
63 }
55 }
64 }
56 }
65 readonly property real fixedArtShapeSizeAspect: (root.fixedArtShapeSize.height > 0 && root.fixedArtShapeSize.width > 0) ? root.fixedArtShapeSize.width / root.fixedArtShapeSize.height : -1;
57 readonly property real fixedArtShapeSizeAspect: (root.fixedArtShapeSize.height > 0 && root.fixedArtShapeSize.width > 0) ? root.fixedArtShapeSize.width / root.fixedArtShapeSize.height : -1;
@@ -80,6 +72,7 @@ Item {
80 objectName: "artImage";
72 objectName: "artImage";
81 source: artShapeLoader.cardArt;
73 source: artShapeLoader.cardArt;
82 asynchronous: false;
74 asynchronous: false;
75+ visible: !false;
83 width: root.width;
76 width: root.width;
84 height: width / artShape.aspect;
77 height: width / artShape.aspect;
85 }
78 }