@@ -22,9 +22,6 @@ Item {
2222 property alias mascot: mascotImage.source
2323 property alias title: titleLabel.text
2424 property alias subtitle: subtitleLabel.text
25− property alias price: priceLabel.text
26− property alias oldPrice: oldPriceLabel.text
27− property alias altPrice: altPriceLabel.text
2825
2926 property alias titleWeight: titleLabel.font.weight
3027
@@ -33,7 +30,11 @@ Item {
3330
3431 property alias headerAlignment: titleLabel.horizontalAlignment
3532
36− visible: mascotImage.status === Image.Ready || title || price
33+ property bool inOverlay: false
34+ property bool useMascotShape: true
35+ property color fontColor: Theme.palette.selected.backgroundText
36+
37+ visible: mascotImage.status === Image.Ready || title
3738 height: row.height > 0 ? row.height + row.margins * 2 : 0
3839
3940 Row {
@@ -42,13 +43,13 @@ Item {
4243
4344 property real margins: units.gu(1)
4445
46+ spacing: mascotShape.visible || mascotImage.visible || inOverlay ? margins : 0
4547 anchors {
4648 top: parent.top; left: parent.left; right: parent.right
4749 margins: margins
4850 leftMargin: spacing
4951 rightMargin: spacing
5052 }
51− spacing: mascotShape.visible || (template && template["overlay"]) ? margins : 0
5253
5354 UbuntuShape {
5455 id: mascotShape
@@ -57,17 +58,24 @@ Item {
5758 // TODO karni: Icon aspect-ratio is 8:7.5. Revisit these values to avoid fraction of pixels.
5859 width: units.gu(6)
5960 height: units.gu(5.625)
60− visible: image.status === Image.Ready
61+ visible: useMascotShape && image && image.status === Image.Ready
6162 readonly property int maxSize: Math.max(width, height)
6263
63− image: Image {
64− id: mascotImage
64+ image: useMascotShape ? mascotImage : null
65+ }
6566
66− sourceSize { width: mascotShape.maxSize; height: mascotShape.maxSize }
67− fillMode: Image.PreserveAspectCrop
68− horizontalAlignment: Image.AlignHCenter
69− verticalAlignment: Image.AlignVCenter
70− }
67+ Image {
68+ id: mascotImage
69+ objectName: "mascotImage"
70+
71+ width: source ? mascotShape.width : 0
72+ height: mascotShape.height
73+ visible: !useMascotShape && status === Image.Ready
74+
75+ sourceSize { width: mascotShape.maxSize; height: mascotShape.maxSize }
76+ fillMode: Image.PreserveAspectCrop
77+ horizontalAlignment: Image.AlignHCenter
78+ verticalAlignment: Image.AlignVCenter
7179 }
7280
7381 Column {
@@ -85,7 +93,7 @@ Item {
8593 maximumLineCount: 2
8694 fontSize: "small"
8795 font.pixelSize: Math.round(FontUtils.sizeToPixels(fontSize) * fontScale)
88− color: template["overlay"] === true ? "white" : Theme.palette.selected.backgroundText
96+ color: fontColor
8997 }
9098
9199 Label {
@@ -97,47 +105,7 @@ Item {
97105 visible: titleLabel.text && text
98106 fontSize: "x-small"
99107 font.pixelSize: Math.round(FontUtils.sizeToPixels(fontSize) * fontScale)
100− color: template["overlay"] === true ? "white" : Theme.palette.selected.backgroundText
101− }
102−
103− Row {
104− id: prices
105− objectName: "prices"
106− anchors { left: parent.left; right: parent.right }
107−
108− property int labels: {
109− var labels = 1; // price always visible
110− if (oldPriceLabel.text !== "") labels += 1;
111− if (altPriceLabel.text !== "") labels += 1;
112− return labels;
113− }
114− property real labelWidth: width / labels
115−
116− Label {
117− id: priceLabel
118− width: parent.labelWidth
119− elide: Text.ElideRight
120− font.weight: Font.DemiBold
121− color: Theme.palette.selected.foreground
122− visible: text
123− }
124−
125− Label {
126− id: oldPriceLabel
127− objectName: "oldPriceLabel"
128− width: parent.labelWidth
129− elide: Text.ElideRight
130− horizontalAlignment: parent.labels === 3 ? Text.AlignHCenter : Text.AlignRight
131− visible: text
132− }
133−
134− Label {
135− id: altPriceLabel
136− width: parent.labelWidth
137− elide: Text.ElideRight
138− horizontalAlignment: Text.AlignRight
139− visible: text
140− }
108+ color: fontColor
141109 }
142110 }
143111 }