3
property var components;
5
property string artShapeStyle: "inset";
6
property real fontScale: 1.0;
7
property var scopeStyle: null;
8
property int titleAlignment: Text.AlignLeft;
9
property int fixedHeaderHeight: -1;
10
property size fixedArtShapeSize: Qt.size(-1, -1);
11
readonly property string title: cardData && cardData["title"] || "";
12
property bool asynchronous: true;
13
property bool showHeader: true;
14
implicitWidth: childrenRect.width;
17
readonly property size artShapeSize: Qt.size(-1, -1);
18
readonly property int headerHeight: titleLabel.height + subtitleLabel.height + subtitleLabel.anchors.topMargin + audioProgressBar.height + audioProgressBar.anchors.topMargin;
21
objectName: "titleLabel";
22
anchors { right: parent.right;
23
rightMargin: units.gu(1);
24
left: audioButton.right;
25
leftMargin: units.gu(1);
27
topMargin: units.gu(1);
29
elide: Text.ElideRight;
33
font.pixelSize: Math.round(FontUtils.sizeToPixels(fontSize) * fontScale);
34
color: root.scopeStyle ? root.scopeStyle.foreground : theme.palette.normal.baseText;
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;
62
duration: (cardData["quickPreviewData"] && cardData["quickPreviewData"]["duration"]) || 0;
63
source: (cardData["quickPreviewData"] && cardData["quickPreviewData"]["uri"]) || "";
65
bottom: audioButton.bottom;
66
left: audioButton.right;
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"]) || "";
79
visible: parent.pressed;
84
anchors.margins: parent.height > units.gu(5) ? units.gu(2) : 0;
86
name: DashAudioPlayer.playing && AudioUrlComparer.compare(parent.source, DashAudioPlayer.currentSource) ? "media-playback-pause" : "media-playback-start";
89
if (AudioUrlComparer.compare(source, DashAudioPlayer.currentSource)) {
90
if (DashAudioPlayer.playing) {
91
DashAudioPlayer.pause();
93
DashAudioPlayer.play();
96
var playlist = (cardData["quickPreviewData"] && cardData["quickPreviewData"]["playlist"]) || null;
97
DashAudioPlayer.playSource(source, playlist);
105
objectName: "touchdown";
106
anchors { fill: root }
107
visible: root.artShapeStyle != "shadow" && root.artShapeStyle != "icon" && root.pressed;
109
borderSource: "radius_pressed.sci"
111
implicitHeight: audioButton.height;