@@ -5,8 +5,8 @@ AbstractButton {
55 property var cardData;
66 property var artShapeBorderSource: undefined;
77 property real fontScale: 1.0;
8− property var scopeStyle: null;
9− property int headerAlignment: Text.AlignLeft;
8+ property var scopeStyle: null;
9+ property int headerAlignment: Text.AlignLeft;
1010 property int fixedHeaderHeight: -1;
1111 property size fixedArtShapeSize: Qt.size(-1, -1);
1212 readonly property string title: cardData && cardData["title"] || "";
@@ -16,99 +16,104 @@ AbstractButton {
1616readonly property size artShapeSize: Qt.size(-1, -1);
1717readonly property int headerHeight: row.height;
1818Row {
19− id: row;
20− objectName: "outerRow";
21− property real margins: units.gu(1);
22− spacing: margins;
23− height: root.fixedHeaderHeight != -1 ? root.fixedHeaderHeight : implicitHeight;
24− anchors { top: parent.top;
19+ id: row;
20+ objectName: "outerRow";
21+ property real margins: units.gu(1);
22+ spacing: margins;
23+ height: root.fixedHeaderHeight != -1 ? root.fixedHeaderHeight : implicitHeight;
24+ anchors { top: parent.top;
2525 topMargin: units.gu(1);
26− left: parent.left;
27−}
28− anchors.right: parent.right;
29− anchors.margins: margins;
30− anchors.rightMargin: 0;
31−data: [
32−Loader {
33− id: mascotShapeLoader;
34− objectName: "mascotShapeLoader";
35− asynchronous: root.asynchronous;
36− active: mascotImage.status === Image.Ready;
37− visible: showHeader && active && status == Loader.Ready;
38− width: units.gu(6);
39− height: units.gu(5.625);
40− sourceComponent: UbuntuShape { image: mascotImage }
41− anchors { verticalCenter: parent.verticalCenter; }
42− }
43−
26+left: parent.left;
27+ }
28+ anchors.right: parent.right;
29+ anchors.margins: margins;
30+ anchors.rightMargin: 0;
31+ data: [
32+ Loader {
33+ id: mascotShapeLoader;
34+ objectName: "mascotShapeLoader";
35+ asynchronous: root.asynchronous;
36+ active: mascotImage.status === Image.Ready;
37+ visible: showHeader && active && status == Loader.Ready;
38+ width: units.gu(6);
39+ height: units.gu(5.625);
40+ sourceComponent: UbuntuShape { image: mascotImage }
41+ anchors { verticalCenter: parent.verticalCenter; }
42+ }
4443,Image {
45− id: mascotImage;
46− objectName: "mascotImage";
47− anchors { verticalCenter: parent.verticalCenter; }
48− readonly property int maxSize: Math.max(width, height) * 4;
49− source: cardData && cardData["mascot"] || "";
50− width: units.gu(6);
51− height: units.gu(5.625);
52− sourceSize { width: maxSize; height: maxSize }
53− fillMode: Image.PreserveAspectCrop;
54− horizontalAlignment: Image.AlignHCenter;
55− verticalAlignment: Image.AlignVCenter;
56− visible: false;
57− }
58−
44+ id: mascotImage;
45+ objectName: "mascotImage";
46+ anchors { verticalCenter: parent.verticalCenter; }
47+ readonly property int maxSize: Math.max(width, height) * 4;
48+ source: cardData && cardData["mascot"] || "";
49+ width: units.gu(6);
50+ height: units.gu(5.625);
51+ sourceSize { width: maxSize; height: maxSize }
52+ fillMode: Image.PreserveAspectCrop;
53+ horizontalAlignment: Image.AlignHCenter;
54+ verticalAlignment: Image.AlignVCenter;
55+ visible: false;
56+ }
5957,Item {
6058 id: headerTitleContainer;
6159 anchors { verticalCenter: parent.verticalCenter; }
6260 width: parent.width - x;
6361 implicitHeight: titleLabel.height + subtitleLabel.height;
6462 data: [
65−Label {
66− id: titleLabel;
67− objectName: "titleLabel";
68− anchors { right: parent.right;
69− rightMargin: units.gu(1);
70− left: parent.left;
71− top: parent.top; }
72− elide: Text.ElideRight;
73− fontSize: "small";
74− wrapMode: Text.Wrap;
75− maximumLineCount: 2;
76− font.pixelSize: Math.round(FontUtils.sizeToPixels(fontSize) * fontScale);
77− color: root.scopeStyle ? root.scopeStyle.foreground : Theme.palette.normal.baseText;
78− visible: showHeader ;
79− text: root.title;
80− font.weight: components && components["subtitle"] ? Font.DemiBold : Font.Normal;
81− horizontalAlignment: root.headerAlignment;
82− }
83−,Label {
84− id: subtitleLabel;
85− objectName: "subtitleLabel";
63+ Label {
64+ id: titleLabel;
65+ objectName: "titleLabel";
8666 anchors { right: parent.right;
87− left: parent.left;
88− rightMargin: units.gu(1);
89− top: titleLabel.bottom;
90− }
91− anchors.topMargin: units.dp(2);
67+rightMargin: units.gu(1);
68+left: parent.left;
69+ top: parent.top; }
9270 elide: Text.ElideRight;
9371 fontSize: "small";
72+ wrapMode: Text.Wrap;
73+ maximumLineCount: 2;
9474 font.pixelSize: Math.round(FontUtils.sizeToPixels(fontSize) * fontScale);
95− color: root.scopeStyle ? root.scopeStyle.foreground : Theme.palette.normal.baseText;
96− visible: titleLabel.visible && titleLabel.text;
97− text: cardData && cardData["subtitle"] || "";
98− font.weight: Font.Light;
75+ color: root.scopeStyle ? root.scopeStyle.foreground : Theme.palette.normal.baseText;
76+ visible: showHeader ;
77+ text: root.title;
78+ font.weight: components && components["subtitle"] ? Font.DemiBold : Font.Normal;
9979 horizontalAlignment: root.headerAlignment;
10080 }
101−]
102−}
103−]
104−}
105−UbuntuShape {
106− id: touchdown;
107− objectName: "touchdown";
108− anchors { fill: root }
109− visible: root.pressed;
110− radius: "medium";
111− borderSource: "radius_pressed.sci"
112−}
81+,Label {
82+ id: subtitleLabel;
83+ objectName: "subtitleLabel";
84+ anchors { right: parent.right;
85+ left: parent.left;
86+rightMargin: units.gu(1);
87+top: titleLabel.bottom;
88+ }
89+ anchors.topMargin: units.dp(2);
90+ elide: Text.ElideRight;
91+ fontSize: "small";
92+ font.pixelSize: Math.round(FontUtils.sizeToPixels(fontSize) * fontScale);
93+ color: root.scopeStyle ? root.scopeStyle.foreground : Theme.palette.normal.baseText;
94+ visible: titleLabel.visible && titleLabel.text;
95+ text: cardData && cardData["subtitle"] || "";
96+ font.weight: Font.Light;
97+ horizontalAlignment: root.headerAlignment;
98+ }
99+
100+ ]
101+ }
102+
103+ ]
104+ }
105+UbuntuShape {
106+ id: touchdown;
107+ objectName: "touchdown";
108+ anchors { fill: root }
109+ visible: {
110+ if (root.template && root.template["non-interactive"]) {
111+ return false;
112+ }
113+ return root.pressed;
114+ }
115+ radius: "medium";
116+ borderSource: "radius_pressed.sci"
117+ }
113118implicitHeight: row.y + row.height + units.gu(1);
114119}