@@ -1,112 +1,112 @@
1−AbstractButton {
1+AbstractButton {
2− id: root;
2+ id: root;
3− property var template;
4− property var components;
3+ property var components;
5− property var cardData;
4+ property var cardData;
6− property var artShapeBorderSource: undefined;
5+ property var artShapeBorderSource: undefined;
7− property real fontScale: 1.0;
6+ property real fontScale: 1.0;
8− property var scopeStyle: null;
7+ property var scopeStyle: null;
9− property int titleAlignment: Text.AlignLeft;
8+ property int titleAlignment: Text.AlignLeft;
10− property int fixedHeaderHeight: -1;
9+ property int fixedHeaderHeight: -1;
11− property size fixedArtShapeSize: Qt.size(-1, -1);
10+ property size fixedArtShapeSize: Qt.size(-1, -1);
12− readonly property string title: cardData && cardData["title"] || "";
11+ readonly property string title: cardData && cardData["title"] || "";
13− property bool asynchronous: true;
12+ property bool asynchronous: true;
14− property bool showHeader: true;
13+ property bool showHeader: true;
15− implicitWidth: childrenRect.width;
14+ implicitWidth: childrenRect.width;
16− enabled: root.template == null ? true : (root.template["non-interactive"] !== undefined ? !root.template["non-interactive"] : true);
15+ enabled: true;
18readonly property size artShapeSize: Qt.size(-1, -1);
17readonly property size artShapeSize: Qt.size(-1, -1);
19readonly property int headerHeight: titleLabel.height + subtitleLabel.height + subtitleLabel.anchors.topMargin + audioProgressBar.height + audioProgressBar.anchors.topMargin;
18readonly property int headerHeight: titleLabel.height + subtitleLabel.height + subtitleLabel.anchors.topMargin + audioProgressBar.height + audioProgressBar.anchors.topMargin;
21− id: titleLabel;
20+ id: titleLabel;
22− objectName: "titleLabel";
21+ objectName: "titleLabel";
23− anchors { right: parent.right;
22+ anchors { right: parent.right;
24rightMargin: units.gu(1);
23rightMargin: units.gu(1);
25left: audioButton.right;
24left: audioButton.right;
26 leftMargin: units.gu(1);
25 leftMargin: units.gu(1);
27top: parent.top;
26top: parent.top;
28 topMargin: units.gu(1);
27 topMargin: units.gu(1);
30− elide: Text.ElideRight;
29+ elide: Text.ElideRight;
31− fontSize: "small";
30+ fontSize: "small";
32− wrapMode: Text.Wrap;
31+ wrapMode: Text.Wrap;
33− maximumLineCount: 2;
32+ maximumLineCount: 2;
34− font.pixelSize: Math.round(FontUtils.sizeToPixels(fontSize) * fontScale);
33+ font.pixelSize: Math.round(FontUtils.sizeToPixels(fontSize) * fontScale);
35− color: root.scopeStyle ? root.scopeStyle.foreground : Theme.palette.normal.baseText;
34+ color: root.scopeStyle ? root.scopeStyle.foreground : Theme.palette.normal.baseText;
36− visible: showHeader ;
35+ visible: showHeader ;
37− text: root.title;
36+ text: root.title;
38− font.weight: cardData && cardData["subtitle"] ? Font.DemiBold : Font.Normal;
37+ font.weight: cardData && cardData["subtitle"] ? Font.DemiBold : Font.Normal;
39− horizontalAlignment: root.titleAlignment;
38+ horizontalAlignment: root.titleAlignment;
42− id: subtitleLabel;
41+ id: subtitleLabel;
43− objectName: "subtitleLabel";
42+ objectName: "subtitleLabel";
44− anchors { left: titleLabel.left;
43+ anchors { left: titleLabel.left;
45− leftMargin: titleLabel.leftMargin;
44+ leftMargin: titleLabel.leftMargin;
46−rightMargin: units.gu(1);
45+rightMargin: units.gu(1);
47−right: titleLabel.right;
46+right: titleLabel.right;
48top: titleLabel.bottom;
47top: titleLabel.bottom;
50− anchors.topMargin: units.dp(2);
49+ anchors.topMargin: units.dp(2);
51− elide: Text.ElideRight;
50+ elide: Text.ElideRight;
52− maximumLineCount: 1;
51+ maximumLineCount: 1;
53− fontSize: "x-small";
52+ fontSize: "x-small";
54− font.pixelSize: Math.round(FontUtils.sizeToPixels(fontSize) * fontScale);
53+ font.pixelSize: Math.round(FontUtils.sizeToPixels(fontSize) * fontScale);
55− color: root.scopeStyle ? root.scopeStyle.foreground : Theme.palette.normal.baseText;
54+ color: root.scopeStyle ? root.scopeStyle.foreground : Theme.palette.normal.baseText;
56− visible: titleLabel.visible && titleLabel.text;
55+ visible: titleLabel.visible && titleLabel.text;
57− text: cardData && cardData["subtitle"] || "";
56+ text: cardData && cardData["subtitle"] || "";
58− font.weight: Font.Light;
57+ font.weight: Font.Light;
60−CardAudioProgress {
59+CardAudioProgress {
61− id: audioProgressBar;
60+ id: audioProgressBar;
62− duration: (cardData["quickPreviewData"] && cardData["quickPreviewData"]["duration"]) || 0;
61+ duration: (cardData["quickPreviewData"] && cardData["quickPreviewData"]["duration"]) || 0;
63− source: (cardData["quickPreviewData"] && cardData["quickPreviewData"]["uri"]) || "";
62+ source: (cardData["quickPreviewData"] && cardData["quickPreviewData"]["uri"]) || "";
64− anchors {
63+ anchors {
65− bottom: audioButton.bottom;
64+ bottom: audioButton.bottom;
66− left: audioButton.right;
65+ left: audioButton.right;
67− right: parent.right;
66+ right: parent.right;
68− margins: units.gu(1);
67+ margins: units.gu(1);
70− color: root.scopeStyle ? root.scopeStyle.foreground : Theme.palette.normal.baseText;
69+ color: root.scopeStyle ? root.scopeStyle.foreground : Theme.palette.normal.baseText;
71− }AbstractButton {
70+ }AbstractButton {
72− id: audioButton;
71+ id: audioButton;
73− anchors.fill: undefined;
72+ anchors.fill: undefined;
74− width: height;
73+ width: height;
75− height: (root.fixedHeaderHeight > 0 ? root.fixedHeaderHeight : headerHeight) + 2 * units.gu(1);
74+ height: (root.fixedHeaderHeight > 0 ? root.fixedHeaderHeight : headerHeight) + 2 * units.gu(1);
76− readonly property url source: (cardData["quickPreviewData"] && cardData["quickPreviewData"]["uri"]) || "";
75+ readonly property url source: (cardData["quickPreviewData"] && cardData["quickPreviewData"]["uri"]) || "";
76+ readonly property url playlist: (cardData["quickPreviewData"] && cardData["quickPreviewData"]["playlist"]) || null;
77− UbuntuShape {
77+ UbuntuShape {
78− anchors.fill: parent;
78+ anchors.fill: parent;
79− visible: parent.pressed;
79+ visible: parent.pressed;
80− radius: "medium";
80+ radius: "medium";
81− borderSource: "radius_pressed.sci"
81+ borderSource: "radius_pressed.sci"
84− anchors.fill: parent;
84+ anchors.fill: parent;
85− anchors.margins: parent.height > units.gu(5) ? units.gu(2) : units.gu(0);
85+ anchors.margins: parent.height > units.gu(5) ? units.gu(2) : units.gu(0);
86− opacity: 0.9;
86+ opacity: 0.9;
87− name: DashAudioPlayer.isCurrentSource(parent.source) && DashAudioPlayer.playing ? "media-playback-pause" : "media-playback-start";
87+ name: DashAudioPlayer.isCurrentSource(parent.source) && DashAudioPlayer.playing ? "media-playback-pause" : "media-playback-start";
89− onClicked: {
89+ onClicked: {
90− if (DashAudioPlayer.isCurrentSource(source)) {
90+ if (DashAudioPlayer.isCurrentSource(source)) {
91− if (DashAudioPlayer.playing) {
91+ if (DashAudioPlayer.playing) {
92− DashAudioPlayer.pause();
92+ DashAudioPlayer.pause();
93− } else {
93+ } else {
94− DashAudioPlayer.play();
94+ DashAudioPlayer.play();
96− } else {
96+ } else {
97− DashAudioPlayer.playSource(source);
97+ DashAudioPlayer.playSource(source, playlist);
100− onPressAndHold: {
100+ onPressAndHold: {
101− root.pressAndHold();
101+ root.pressAndHold();
103− }UbuntuShape {
103+ }UbuntuShape {
104− id: touchdown;
104+ id: touchdown;
105− objectName: "touchdown";
105+ objectName: "touchdown";
106− anchors { fill: root }
106+ anchors { fill: root }
107− visible: root.pressed;
107+ visible: root.pressed;
108− radius: "medium";
108+ radius: "medium";
109− borderSource: "radius_pressed.sci"
109+ borderSource: "radius_pressed.sci"
111implicitHeight: audioButton.height;
111implicitHeight: audioButton.height;