@@ -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 titleAlignment: Text.AlignLeft;
8+ property var scopeStyle: null;
9+ property int titleAlignment: Text.AlignLeft;
1010 property int fixedHeaderHeight: -1;
1111 property size fixedArtShapeSize: Qt.size(-1, -1);
1212 readonly property string title: cardData && cardData["title"] || "";
@@ -16,101 +16,101 @@ 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−,CroppedImageMinimumSourceSize {
44− id: mascotImage;
45− objectName: "mascotImage";
46− anchors { verticalCenter: parent.verticalCenter; }
47− property bool doLoadSource: !NetworkingStatus.limitedBandwith;
48− source: { if (root.visible) doLoadSource = true; return doLoadSource && cardData && cardData["mascot"] || ""; }
49− width: units.gu(6);
50− height: units.gu(5.625);
51− horizontalAlignment: Image.AlignHCenter;
52− verticalAlignment: Image.AlignVCenter;
53− visible: false;
54− }
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+
44+,CroppedImageMinimumSourceSize {
45+ id: mascotImage;
46+ objectName: "mascotImage";
47+ anchors { verticalCenter: parent.verticalCenter; }
48+ property bool doLoadSource: !NetworkingStatus.limitedBandwith;
49+ source: { if (root.visible) doLoadSource = true; return doLoadSource && cardData && cardData["mascot"] || ""; }
50+ width: units.gu(6);
51+ height: units.gu(5.625);
52+ horizontalAlignment: Image.AlignHCenter;
53+ verticalAlignment: Image.AlignVCenter;
54+ visible: false;
55+ }
56+
5557,Item {
5658 id: headerTitleContainer;
5759 anchors { verticalCenter: parent.verticalCenter; }
5860 width: parent.width - x;
5961 implicitHeight: titleLabel.height + subtitleLabel.height;
6062 data: [
61− Label {
62− id: titleLabel;
63− objectName: "titleLabel";
63+Label {
64+ id: titleLabel;
65+ objectName: "titleLabel";
66+ anchors { right: parent.right;
67+ rightMargin: units.gu(1);
68+ left: parent.left;
69+ top: parent.top; }
70+ elide: Text.ElideRight;
71+ fontSize: "small";
72+ wrapMode: Text.Wrap;
73+ maximumLineCount: 2;
74+ font.pixelSize: Math.round(FontUtils.sizeToPixels(fontSize) * fontScale);
75+ color: root.scopeStyle ? root.scopeStyle.foreground : Theme.palette.normal.baseText;
76+ visible: showHeader ;
77+ text: root.title;
78+ font.weight: cardData && cardData["subtitle"] ? Font.DemiBold : Font.Normal;
79+ horizontalAlignment: root.titleAlignment;
80+ }
81+,Label {
82+ id: subtitleLabel;
83+ objectName: "subtitleLabel";
6484 anchors { right: parent.right;
65−rightMargin: units.gu(1);
66−left: parent.left;
67− top: parent.top; }
85+ left: parent.left;
86+ rightMargin: units.gu(1);
87+ top: titleLabel.bottom;
88+ }
89+ anchors.topMargin: units.dp(2);
6890 elide: Text.ElideRight;
69− fontSize: "small";
70− wrapMode: Text.Wrap;
71− maximumLineCount: 2;
91+ fontSize: "x-small";
7292 font.pixelSize: Math.round(FontUtils.sizeToPixels(fontSize) * fontScale);
73− color: root.scopeStyle ? root.scopeStyle.foreground : Theme.palette.normal.baseText;
74− visible: showHeader ;
75− text: root.title;
76− font.weight: cardData && cardData["subtitle"] ? Font.DemiBold : Font.Normal;
77− horizontalAlignment: root.titleAlignment;
78− }
79−,Label {
80− id: subtitleLabel;
81− objectName: "subtitleLabel";
82− anchors { right: parent.right;
83− left: parent.left;
84−rightMargin: units.gu(1);
85−top: titleLabel.bottom;
86− }
87− anchors.topMargin: units.dp(2);
88− elide: Text.ElideRight;
89− fontSize: "x-small";
90− font.pixelSize: Math.round(FontUtils.sizeToPixels(fontSize) * fontScale);
91− color: root.scopeStyle ? root.scopeStyle.foreground : Theme.palette.normal.baseText;
92− visible: titleLabel.visible && titleLabel.text;
93− text: cardData && cardData["subtitle"] || "";
94− font.weight: Font.Light;
95− }
96−
97− ]
98− }
99−
100− ]
101− }
102−UbuntuShape {
103− id: touchdown;
104− objectName: "touchdown";
105− anchors { fill: root }
106− visible: {
107− if (root.template && root.template["non-interactive"]) {
108− return false;
109− }
110− return root.pressed;
111− }
112− radius: "medium";
113− borderSource: "radius_pressed.sci"
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;
11497 }
98+]
99+}
100+]
101+}
102+UbuntuShape {
103+ id: touchdown;
104+ objectName: "touchdown";
105+ anchors { fill: root }
106+ visible: {
107+ if (root.template && root.template["non-interactive"]) {
108+ return false;
109+ }
110+ return root.pressed;
111+ }
112+ radius: "medium";
113+ borderSource: "radius_pressed.sci"
114+}
115115implicitHeight: row.y + row.height + units.gu(1);
116116}