@@ -0,0 +1,109 @@
3+ property var template;
4+ property var components;
5+ property var cardData;
6+ property var artShapeBorderSource: undefined;
7+ property real fontScale: 1.0;
8+ property var scopeStyle: null;
9+ property int titleAlignment: Text.AlignLeft;
10+ property int fixedHeaderHeight: -1;
11+ property size fixedArtShapeSize: Qt.size(-1, -1);
12+ readonly property string title: cardData && cardData["title"] || "";
13+ property bool asynchronous: true;
14+ property bool showHeader: true;
15+ implicitWidth: childrenRect.width;
16+ enabled: root.template == null ? true : (root.template["non-interactive"] !== undefined ? !root.template["non-interactive"] : true);
18+readonly property size artShapeSize: Qt.size(-1, -1);
19+readonly property int headerHeight: titleLabel.height + subtitleLabel.height + subtitleLabel.anchors.topMargin + audioProgressBar.height + audioProgressBar.anchors.topMargin;
22+ objectName: "titleLabel";
23+ anchors { right: parent.right;
24+rightMargin: units.gu(1);
25+left: audioButton.right;
26+ leftMargin: units.gu(1);
28+ topMargin: units.gu(1);
30+ elide: Text.ElideRight;
34+ font.pixelSize: Math.round(FontUtils.sizeToPixels(fontSize) * fontScale);
35+ color: root.scopeStyle ? root.scopeStyle.foreground : Theme.palette.normal.baseText;
36+ visible: showHeader ;
38+ font.weight: cardData && cardData["subtitle"] ? Font.DemiBold : Font.Normal;
39+ horizontalAlignment: root.titleAlignment;
43+ objectName: "subtitleLabel";
44+ anchors { left: titleLabel.left;
45+ leftMargin: titleLabel.leftMargin;
46+rightMargin: units.gu(1);
47+right: titleLabel.right;
48+top: titleLabel.bottom;
50+ anchors.topMargin: units.dp(2);
51+ elide: Text.ElideRight;
54+ font.pixelSize: Math.round(FontUtils.sizeToPixels(fontSize) * fontScale);
55+ color: root.scopeStyle ? root.scopeStyle.foreground : Theme.palette.normal.baseText;
56+ visible: titleLabel.visible && titleLabel.text;
57+ text: cardData && cardData["subtitle"] || "";
58+ font.weight: Font.Light;
61+ id: audioProgressBar;
62+ duration: (cardData["quickPreviewData"] && cardData["quickPreviewData"]["duration"]) || 0;
63+ source: (cardData["quickPreviewData"] && cardData["quickPreviewData"]["uri"]) || "";
65+ bottom: audioButton.bottom;
66+ left: audioButton.right;
68+ margins: units.gu(1);
70+ color: root.scopeStyle ? root.scopeStyle.foreground : Theme.palette.normal.baseText;
73+ anchors.fill: undefined;
75+ height: (root.fixedHeaderHeight > 0 ? root.fixedHeaderHeight : headerHeight) + 2 * units.gu(1);
76+ readonly property url source: (cardData["quickPreviewData"] && cardData["quickPreviewData"]["uri"]) || "";
78+ anchors.fill: parent;
79+ visible: parent.pressed;
81+ borderSource: "radius_pressed.sci"
84+ anchors.fill: parent;
85+ anchors.margins: parent.height > units.gu(5) ? units.gu(2) : units.gu(0);
87+ name: DashAudioPlayer.isCurrentSource(parent.source) && DashAudioPlayer.playing ? "media-playback-pause" : "media-playback-start";
90+ if (DashAudioPlayer.isCurrentSource(source)) {
91+ if (DashAudioPlayer.playing) {
92+ DashAudioPlayer.pause();
94+ DashAudioPlayer.play();
97+ DashAudioPlayer.playSource(source);
102+ objectName: "touchdown";
103+ anchors { fill: root }
104+ visible: root.pressed;
106+ borderSource: "radius_pressed.sci"
108+implicitHeight: audioButton.height;