Debian Codegraph @

src/context/applets/currenttrack/package/contents/ui/StatsItem.qml

raw
1 /****************************************************************************************
2 * Copyright (c) 2017 Malte Veerman <[email protected]> *
3 * *
4 * This program is free software; you can redistribute it and/or modify it under *
5 * the terms of the GNU General Public License as published by the Free Software *
6 * Foundation; either version 2 of the License, or (at your option) any later *
7 * version. *
8 * *
9 * This program is distributed in the hope that it will be useful, but WITHOUT ANY *
10 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A *
11 * PARTICULAR PURPOSE. See the GNU General Public License for more details. *
12 * *
13 * You should have received a copy of the GNU General Public License along with *
14 * this program. If not, see <http://www.gnu.org/licenses/>. *
15 ****************************************************************************************/
16
17 import QtQuick 2.15
18 import QtQuick.Controls 2.15
19 import org.kde.amarok.currenttrack 1.0
20 import org.kde.kirigami 2.14 as Kirigami
21
22 Item {
23 id: root
24
25 property alias playCount: playCountLabel.text
26 property alias score: scoreLabel.text
27 property alias lastPlayed: lastPlayedLabel.text
28
29 Row {
30 height: parent.height / 2
31
32 Label {
33 text: i18n("Play Count")
34 width: root.width / 3
35 height: parent.height
36 horizontalAlignment: Text.AlignHCenter
37 maximumLineCount: 1
38 color: Kirigami.Theme.textColor
39 fontSizeMode: Text.Fit
40 font.pointSize: 32
41 minimumPointSize: 9
42 }
43 Label {
44 text: i18n("Score")
45 width: root.width / 3
46 height: parent.height
47 horizontalAlignment: Text.AlignHCenter
48 maximumLineCount: 1
49 color: Kirigami.Theme.textColor
50 fontSizeMode: Text.Fit
51 font.pointSize: 32
52 minimumPointSize: 9
53 }
54 Label {
55 text: i18n("Last played")
56 width: root.width / 3
57 height: parent.height
58 horizontalAlignment: Text.AlignHCenter
59 maximumLineCount: 1
60 color: Kirigami.Theme.textColor
61 fontSizeMode: Text.Fit
62 font.pointSize: 32
63 minimumPointSize: 9
64 }
65 }
66 Rectangle {
67 width: parent.width
68 height: parent.height / 2
69 anchors.bottom: parent.bottom
70 color: palette.base
71
72 Row {
73 height: parent.height
74
75 Label {
76 id: playCountLabel
77
78 width: root.width / 3
79 height: parent.height
80 horizontalAlignment: Text.AlignHCenter
81 maximumLineCount: 1
82 color: Kirigami.Theme.textColor
83 fontSizeMode: Text.Fit
84 font.pointSize: 32
85 minimumPointSize: 9
86 font.bold: true
87 text: CurrentTrackEngine.timesPlayed
88 elide: Text.ElideRight
89 }
90 Label {
91 id: scoreLabel
92
93 width: root.width / 3
94 height: parent.height
95 horizontalAlignment: Text.AlignHCenter
96 maximumLineCount: 1
97 color: Kirigami.Theme.textColor
98 fontSizeMode: Text.Fit
99 font.pointSize: 32
100 minimumPointSize: 9
101 font.bold: true
102 text: CurrentTrackEngine.score
103 elide: Text.ElideRight
104 }
105 Label {
106 id: lastPlayedLabel
107
108 width: root.width / 3
109 height: parent.height
110 horizontalAlignment: Text.AlignHCenter
111 maximumLineCount: 1
112 color: Kirigami.Theme.textColor
113 fontSizeMode: Text.Fit
114 font.pointSize: 32
115 minimumPointSize: 9
116 font.bold: true
117 text: CurrentTrackEngine.lastPlayed
118 elide: Text.ElideRight
119 }
120 }
121 }
122
123 SystemPalette {
124 id: palette
125 }
126 }