@@ -30,9 +30,8 @@ Item {
30 property real fontScale: 1.0
30 property real fontScale: 1.0
32 property alias headerAlignment: titleLabel.horizontalAlignment
32 property alias headerAlignment: titleLabel.horizontalAlignment
33− property bool inOverlay: template["overlay"] === true
33+ property bool useMascotShape: true
34− property bool hasBackground: template && template["card-background"] !== undefined
34+ property color fontColor: "grey"
35− property color fontColor: getFontColor(background.color)
37 visible: mascotImage.status === Image.Ready || title || price
36 visible: mascotImage.status === Image.Ready || title || price
38 height: row.height > 0 ? row.height + row.margins * 2 : 0
37 height: row.height > 0 ? row.height + row.margins * 2 : 0
@@ -43,7 +42,7 @@ Item {
44 property real margins: units.gu(1)
43 property real margins: units.gu(1)
46− spacing: mascotShape.visible || mascotImage.visible || inOverlay ? units.gu(0.5) : 0
45+ spacing: mascotShape.visible || mascotImage.visible || inOverlay ? margins : 0
48 top: parent.top; left: parent.left; right: parent.right
47 top: parent.top; left: parent.left; right: parent.right
49 margins: margins
48 margins: margins
@@ -58,10 +57,10 @@ Item {
58 // TODO karni: Icon aspect-ratio is 8:7.5. Revisit these values to avoid fraction of pixels.
57 // TODO karni: Icon aspect-ratio is 8:7.5. Revisit these values to avoid fraction of pixels.
59 width: units.gu(6)
58 width: units.gu(6)
60 height: units.gu(5.625)
59 height: units.gu(5.625)
61− visible: !hasBackground && image && image.status === Image.Ready
60+ visible: useMascotShape && image && image.status === Image.Ready
62 readonly property int maxSize: Math.max(width, height)
61 readonly property int maxSize: Math.max(width, height)
64− image: hasBackground ? null : mascotImage
63+ image: useMascotShape ? mascotImage : null
@@ -69,7 +68,7 @@ Item {
70 width: source ? mascotShape.width : 0
69 width: source ? mascotShape.width : 0
71 height: mascotShape.height
70 height: mascotShape.height
72− visible: hasBackground && status === Image.Ready
71+ visible: !useMascotShape && status === Image.Ready
74 sourceSize { width: mascotShape.maxSize; height: mascotShape.maxSize }
73 sourceSize { width: mascotShape.maxSize; height: mascotShape.maxSize }
75 fillMode: Image.PreserveAspectCrop
74 fillMode: Image.PreserveAspectCrop
@@ -151,16 +150,4 @@ Item {
155− function getLuminance(color) {
156− return 0.2126 * color.r + 0.7152 * color.g + 0.0722 * color.b;
159− // TODO karni: Change "grey" to Ubuntu.Components.Palette color once updated.
160− function getFontColor(backgroundColor) {
161− if (inOverlay) return "white";
162− if (backgroundColor === undefined) return "grey";
163− var luminance = getLuminance(backgroundColor);
164− return luminance < 0.7 ? "white" : "grey"