@@ -22,18 +22,20 @@ 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
27+ property alias titleSize: titleLabel.fontSize
3028
3129 // FIXME: Saviq, used to scale fonts down in Carousel
3230 property real fontScale: 1.0
3331
3432 property alias headerAlignment: titleLabel.horizontalAlignment
3533
36− visible: mascotImage.status === Image.Ready || title || price
34+ property bool inOverlay: false
35+ property bool useMascotShape: true
36+ property color fontColor: Theme.palette.selected.backgroundText
37+
38+ visible: mascotImage.status === Image.Ready || title
3739 height: row.height > 0 ? row.height + row.margins * 2 : 0
3840
3941 Row {
@@ -42,13 +44,13 @@ Item {
4244
4345 property real margins: units.gu(1)
4446
47+ spacing: mascotShape.visible || mascotImage.visible || inOverlay ? margins : 0
4548 anchors {
4649 top: parent.top; left: parent.left; right: parent.right
4750 margins: margins
4851 leftMargin: spacing
4952 rightMargin: spacing
5053 }
51− spacing: mascotShape.visible || (template && template["overlay"]) ? margins : 0
5254
5355 UbuntuShape {
5456 id: mascotShape
@@ -57,35 +59,45 @@ Item {
5759 // TODO karni: Icon aspect-ratio is 8:7.5. Revisit these values to avoid fraction of pixels.
5860 width: units.gu(6)
5961 height: units.gu(5.625)
60− visible: image.status === Image.Ready
62+ anchors.verticalCenter: parent.verticalCenter
63+ visible: useMascotShape && image && image.status === Image.Ready
6164 readonly property int maxSize: Math.max(width, height)
6265
63− image: Image {
64− id: mascotImage
66+ image: useMascotShape ? mascotImage : null
67+ }
6568
66− sourceSize { width: mascotShape.maxSize; height: mascotShape.maxSize }
67− fillMode: Image.PreserveAspectCrop
68− horizontalAlignment: Image.AlignHCenter
69− verticalAlignment: Image.AlignVCenter
70− }
69+ Image {
70+ id: mascotImage
71+ objectName: "mascotImage"
72+
73+ width: source ? mascotShape.width : 0
74+ height: mascotShape.height
75+ anchors.verticalCenter: parent.verticalCenter
76+ visible: !useMascotShape && status === Image.Ready
77+
78+ sourceSize { width: mascotShape.maxSize; height: mascotShape.maxSize }
79+ fillMode: Image.PreserveAspectCrop
80+ horizontalAlignment: Image.AlignHCenter
81+ verticalAlignment: Image.AlignVCenter
7182 }
7283
7384 Column {
7485 objectName: "column"
7586 width: parent.width - x
76− spacing: units.gu(0.5)
87+ spacing: units.gu(0.25)
88+ anchors.verticalCenter: parent.verticalCenter
7789
7890 Label {
7991 id: titleLabel
8092 objectName: "titleLabel"
8193 anchors { left: parent.left; right: parent.right }
8294 elide: Text.ElideRight
83− font.weight: Font.DemiBold
95+ font.weight: Font.Normal
96+ fontSize: "small"
8497 wrapMode: Text.Wrap
8598 maximumLineCount: 2
86− fontSize: "small"
8799 font.pixelSize: Math.round(FontUtils.sizeToPixels(fontSize) * fontScale)
88− color: template["overlay"] === true ? "white" : Theme.palette.selected.backgroundText
100+ color: fontColor
89101 }
90102
91103 Label {
@@ -93,51 +105,11 @@ Item {
93105 objectName: "subtitleLabel"
94106 anchors { left: parent.left; right: parent.right }
95107 elide: Text.ElideRight
108+ fontSize: "small"
96109 font.weight: Font.Light
97110 visible: titleLabel.text && text
98− fontSize: "x-small"
99111 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− }
112+ color: fontColor
141113 }
142114 }
143115 }