on xenial help sign in
Fix cardcreator test
3c833c4Andrea Cimitan
tests/plugins/Dash/cardcreator/1.res+24−7
@@ -40,13 +40,30 @@ Item {
40 height: 1;
40 height: 1;
41 hideSource: doShapeItem;
41 hideSource: doShapeItem;
42 }
42 }
43− UbuntuShape {
43+ Loader {
44− id: artShapeShape;
45− source: artShapeSource;
46 anchors.fill: parent;
44 anchors.fill: parent;
47− visible: doShapeItem;
45+ visible: artShape.doShapeItem;
46+ sourceComponent: root.artShapeStyle === "icon" ? artShapeIconComponent : artShapeShapeComponent;
47+ Component {
48+ id: artShapeShapeComponent;
49+ UbuntuShape {
50+ source: artShapeSource;
51+ sourceFillMode: UbuntuShape.PreserveAspectCrop;
48− radius: "medium";
52+ radius: "medium";
53+ aspect: {
54+ switch (root.artShapeStyle) {
49− aspect: root.artShapeStyle === "inset" ? UbuntuShape.Inset : UbuntuShape.Flat;
55+ case "inset": return UbuntuShape.Inset;
56+ case "shadow": return UbuntuShape.DropShadow;
57+ default:
58+ case "flat": return UbuntuShape.Flat;
59+ }
60+ }
61+ }
62+ }
63+ Component {
64+ id: artShapeIconComponent;
65+ UbuntuShapeIcon { source: artShapeSource; }
66+ }
50 }
67 }
51 readonly property real fixedArtShapeSizeAspect: (root.fixedArtShapeSize.height > 0 && root.fixedArtShapeSize.width > 0) ? root.fixedArtShapeSize.width / root.fixedArtShapeSize.height : -1;
68 readonly property real fixedArtShapeSizeAspect: (root.fixedArtShapeSize.height > 0 && root.fixedArtShapeSize.width > 0) ? root.fixedArtShapeSize.width / root.fixedArtShapeSize.height : -1;
52 readonly property real aspect: fixedArtShapeSizeAspect > 0 ? fixedArtShapeSizeAspect : components !== undefined ? components["art"]["aspect-ratio"] : 1;
69 readonly property real aspect: fixedArtShapeSizeAspect > 0 ? fixedArtShapeSizeAspect : components !== undefined ? components["art"]["aspect-ratio"] : 1;
@@ -97,7 +114,7 @@ UbuntuShape {
97 id: touchdown;
114 id: touchdown;
98 objectName: "touchdown";
115 objectName: "touchdown";
99 anchors { fill: artShapeHolder }
116 anchors { fill: artShapeHolder }
100− visible: root.pressed;
117+ visible: root.artShapeStyle != "shadow" && root.artShapeStyle != "icon" && root.pressed;
101 radius: "medium";
118 radius: "medium";
102 borderSource: "radius_pressed.sci"
119 borderSource: "radius_pressed.sci"
103}
120}
tests/plugins/Dash/cardcreator/2.res+1−1
@@ -124,7 +124,7 @@ UbuntuShape {
124 id: touchdown;
124 id: touchdown;
125 objectName: "touchdown";
125 objectName: "touchdown";
126 anchors { fill: backgroundLoader }
126 anchors { fill: backgroundLoader }
127− visible: root.pressed;
127+ visible: root.artShapeStyle != "shadow" && root.artShapeStyle != "icon" && root.pressed;
128 radius: "medium";
128 radius: "medium";
129 borderSource: "radius_pressed.sci"
129 borderSource: "radius_pressed.sci"
130}
130}
tests/plugins/Dash/cardcreator/3.res+24−7
@@ -40,13 +40,30 @@ Item {
40 height: 1;
40 height: 1;
41 hideSource: doShapeItem;
41 hideSource: doShapeItem;
42 }
42 }
43− UbuntuShape {
43+ Loader {
44− id: artShapeShape;
45− source: artShapeSource;
46 anchors.fill: parent;
44 anchors.fill: parent;
47− visible: doShapeItem;
45+ visible: artShape.doShapeItem;
46+ sourceComponent: root.artShapeStyle === "icon" ? artShapeIconComponent : artShapeShapeComponent;
47+ Component {
48+ id: artShapeShapeComponent;
49+ UbuntuShape {
50+ source: artShapeSource;
51+ sourceFillMode: UbuntuShape.PreserveAspectCrop;
48− radius: "medium";
52+ radius: "medium";
53+ aspect: {
54+ switch (root.artShapeStyle) {
49− aspect: root.artShapeStyle === "inset" ? UbuntuShape.Inset : UbuntuShape.Flat;
55+ case "inset": return UbuntuShape.Inset;
56+ case "shadow": return UbuntuShape.DropShadow;
57+ default:
58+ case "flat": return UbuntuShape.Flat;
59+ }
60+ }
61+ }
62+ }
63+ Component {
64+ id: artShapeIconComponent;
65+ UbuntuShapeIcon { source: artShapeSource; }
66+ }
50 }
67 }
51 readonly property real fixedArtShapeSizeAspect: (root.fixedArtShapeSize.height > 0 && root.fixedArtShapeSize.width > 0) ? root.fixedArtShapeSize.width / root.fixedArtShapeSize.height : -1;
68 readonly property real fixedArtShapeSizeAspect: (root.fixedArtShapeSize.height > 0 && root.fixedArtShapeSize.width > 0) ? root.fixedArtShapeSize.width / root.fixedArtShapeSize.height : -1;
52 readonly property real aspect: fixedArtShapeSizeAspect > 0 ? fixedArtShapeSizeAspect : components !== undefined ? components["art"]["aspect-ratio"] : 1;
69 readonly property real aspect: fixedArtShapeSizeAspect > 0 ? fixedArtShapeSizeAspect : components !== undefined ? components["art"]["aspect-ratio"] : 1;
@@ -115,7 +132,7 @@ UbuntuShape {
115 id: touchdown;
132 id: touchdown;
116 objectName: "touchdown";
133 objectName: "touchdown";
117 anchors { fill: artShapeHolder }
134 anchors { fill: artShapeHolder }
118− visible: root.pressed;
135+ visible: root.artShapeStyle != "shadow" && root.artShapeStyle != "icon" && root.pressed;
119 radius: "medium";
136 radius: "medium";
120 borderSource: "radius_pressed.sci"
137 borderSource: "radius_pressed.sci"
121}
138}
tests/plugins/Dash/cardcreator/4.res+1−1
@@ -105,7 +105,7 @@ UbuntuShape {
105 id: touchdown;
105 id: touchdown;
106 objectName: "touchdown";
106 objectName: "touchdown";
107 anchors { fill: root }
107 anchors { fill: root }
108− visible: root.pressed;
108+ visible: root.artShapeStyle != "shadow" && root.artShapeStyle != "icon" && root.pressed;
109 radius: "medium";
109 radius: "medium";
110 borderSource: "radius_pressed.sci"
110 borderSource: "radius_pressed.sci"
111}
111}
tests/plugins/Dash/cardcreator/5.res+24−7
@@ -40,13 +40,30 @@ Item {
40 height: 1;
40 height: 1;
41 hideSource: doShapeItem;
41 hideSource: doShapeItem;
42 }
42 }
43− UbuntuShape {
43+ Loader {
44− id: artShapeShape;
45− source: artShapeSource;
46 anchors.fill: parent;
44 anchors.fill: parent;
47− visible: doShapeItem;
45+ visible: artShape.doShapeItem;
46+ sourceComponent: root.artShapeStyle === "icon" ? artShapeIconComponent : artShapeShapeComponent;
47+ Component {
48+ id: artShapeShapeComponent;
49+ UbuntuShape {
50+ source: artShapeSource;
51+ sourceFillMode: UbuntuShape.PreserveAspectCrop;
48− radius: "medium";
52+ radius: "medium";
53+ aspect: {
54+ switch (root.artShapeStyle) {
49− aspect: root.artShapeStyle === "inset" ? UbuntuShape.Inset : UbuntuShape.Flat;
55+ case "inset": return UbuntuShape.Inset;
56+ case "shadow": return UbuntuShape.DropShadow;
57+ default:
58+ case "flat": return UbuntuShape.Flat;
59+ }
60+ }
61+ }
62+ }
63+ Component {
64+ id: artShapeIconComponent;
65+ UbuntuShapeIcon { source: artShapeSource; }
66+ }
50 }
67 }
51 readonly property real fixedArtShapeSizeAspect: (root.fixedArtShapeSize.height > 0 && root.fixedArtShapeSize.width > 0) ? root.fixedArtShapeSize.width / root.fixedArtShapeSize.height : -1;
68 readonly property real fixedArtShapeSizeAspect: (root.fixedArtShapeSize.height > 0 && root.fixedArtShapeSize.width > 0) ? root.fixedArtShapeSize.width / root.fixedArtShapeSize.height : -1;
52 readonly property real aspect: fixedArtShapeSizeAspect > 0 ? fixedArtShapeSizeAspect : components !== undefined ? components["art"]["aspect-ratio"] : 1;
69 readonly property real aspect: fixedArtShapeSizeAspect > 0 ? fixedArtShapeSizeAspect : components !== undefined ? components["art"]["aspect-ratio"] : 1;
@@ -134,7 +151,7 @@ UbuntuShape {
134 id: touchdown;
151 id: touchdown;
135 objectName: "touchdown";
152 objectName: "touchdown";
136 anchors { fill: artShapeHolder }
153 anchors { fill: artShapeHolder }
137− visible: root.pressed;
154+ visible: root.artShapeStyle != "shadow" && root.artShapeStyle != "icon" && root.pressed;
138 radius: "medium";
155 radius: "medium";
139 borderSource: "radius_pressed.sci"
156 borderSource: "radius_pressed.sci"
140}
157}
tests/plugins/Dash/cardcreator/6.res+1−1
@@ -113,7 +113,7 @@ UbuntuShape {
113 id: touchdown;
113 id: touchdown;
114 objectName: "touchdown";
114 objectName: "touchdown";
115 anchors { fill: backgroundLoader }
115 anchors { fill: backgroundLoader }
116− visible: root.pressed;
116+ visible: root.artShapeStyle != "shadow" && root.artShapeStyle != "icon" && root.pressed;
117 radius: "medium";
117 radius: "medium";
118 borderSource: "radius_pressed.sci"
118 borderSource: "radius_pressed.sci"
119}
119}
tests/plugins/Dash/cardcreator/7.res+1−1
@@ -137,7 +137,7 @@ UbuntuShape {
137 id: touchdown;
137 id: touchdown;
138 objectName: "touchdown";
138 objectName: "touchdown";
139 anchors { fill: backgroundLoader }
139 anchors { fill: backgroundLoader }
140− visible: root.pressed;
140+ visible: root.artShapeStyle != "shadow" && root.artShapeStyle != "icon" && root.pressed;
141 radius: "medium";
141 radius: "medium";
142 borderSource: "radius_pressed.sci"
142 borderSource: "radius_pressed.sci"
143}
143}
tests/plugins/Dash/cardcreator/8.res+7−7
@@ -92,12 +92,12 @@ left: parent.left;
92 ]
92 ]
93 }
93 }
94UbuntuShape {
94UbuntuShape {
95− id: touchdown;
95+ id: touchdown;
96− objectName: "touchdown";
96+ objectName: "touchdown";
97− anchors { fill: backgroundLoader }
97+ anchors { fill: backgroundLoader }
98− visible: root.pressed;
98+ visible: root.artShapeStyle != "shadow" && root.artShapeStyle != "icon" && root.pressed;
99− radius: "medium";
99+ radius: "medium";
100− borderSource: "radius_pressed.sci"
100+ borderSource: "radius_pressed.sci"
101− }
101+}
102implicitHeight: row.y + row.height + units.gu(1);
102implicitHeight: row.y + row.height + units.gu(1);
103}
103}