Changeset View
Changeset View
Standalone View
Standalone View
src/qml/PlayListEntry.qml
Show All 32 Lines | 25 | FocusScope { | |||
---|---|---|---|---|---|
33 | property bool isAlternateColor | 33 | property bool isAlternateColor | ||
34 | property bool containsMouse | 34 | property bool containsMouse | ||
35 | property int databaseId: 0 | 35 | property int databaseId: 0 | ||
36 | property string title | 36 | property string title | ||
37 | property string artist | 37 | property string artist | ||
38 | property string album | 38 | property string album | ||
39 | property string albumArtist | 39 | property string albumArtist | ||
40 | property string duration | 40 | property string duration | ||
41 | property url fileName | 41 | property string fileName | ||
42 | property url trackResource | ||||
42 | property url imageUrl | 43 | property url imageUrl | ||
43 | property int trackNumber | 44 | property int trackNumber | ||
44 | property int discNumber | 45 | property int discNumber | ||
45 | property int rating | 46 | property int rating | ||
46 | property bool hasValidDiscNumber: true | 47 | property bool hasValidDiscNumber: true | ||
47 | property int scrollBarWidth | 48 | property int scrollBarWidth | ||
48 | property bool simpleMode: false | 49 | property bool simpleMode: false | ||
50 | property string displayTitle: title ? title : fileName | ||||
49 | 51 | | |||
50 | signal startPlayback() | 52 | signal startPlayback() | ||
51 | signal pausePlayback() | 53 | signal pausePlayback() | ||
52 | signal removeFromPlaylist(var trackIndex) | 54 | signal removeFromPlaylist(var trackIndex) | ||
53 | signal switchToTrack(var trackIndex) | 55 | signal switchToTrack(var trackIndex) | ||
54 | 56 | | |||
55 | Accessible.role: Accessible.ListItem | 57 | Accessible.role: Accessible.ListItem | ||
56 | Accessible.name: title + ' ' + album + ' ' + artist | 58 | Accessible.name: displayTitle + ' ' + album + ' ' + artist | ||
57 | 59 | | |||
58 | height: elisaTheme.playListDelegateHeight | 60 | height: elisaTheme.playListDelegateHeight | ||
59 | 61 | | |||
60 | Action { | 62 | Action { | ||
61 | id: removeFromPlayList | 63 | id: removeFromPlayList | ||
62 | text: i18nc("Remove current track from play list", "Remove") | 64 | text: i18nc("Remove current track from play list", "Remove") | ||
63 | icon.name: "error" | 65 | icon.name: "error" | ||
64 | onTriggered: { | 66 | onTriggered: { | ||
Show All 40 Lines | |||||
105 | 107 | | |||
106 | Loader { | 108 | Loader { | ||
107 | id: metadataLoader | 109 | id: metadataLoader | ||
108 | active: false | 110 | active: false | ||
109 | onLoaded: item.show() | 111 | onLoaded: item.show() | ||
110 | 112 | | |||
111 | sourceComponent: MediaTrackMetadataView { | 113 | sourceComponent: MediaTrackMetadataView { | ||
112 | databaseId: playListEntry.databaseId | 114 | databaseId: playListEntry.databaseId | ||
113 | fileName: playListEntry.fileName | 115 | fileName: playListEntry.trackResource | ||
114 | onRejected: metadataLoader.active = false; | 116 | onRejected: metadataLoader.active = false; | ||
115 | } | 117 | } | ||
116 | } | 118 | } | ||
117 | 119 | | |||
118 | Rectangle { | 120 | Rectangle { | ||
119 | id: entryBackground | 121 | id: entryBackground | ||
120 | 122 | | |||
121 | anchors.fill: parent | 123 | anchors.fill: parent | ||
▲ Show 20 Lines • Show All 165 Lines • ▼ Show 20 Line(s) | 287 | TextMetrics { | |||
287 | 289 | | |||
288 | text: Number(discNumber).toLocaleString(Qt.locale(), 'f', 0) | 290 | text: Number(discNumber).toLocaleString(Qt.locale(), 'f', 0) | ||
289 | } | 291 | } | ||
290 | } | 292 | } | ||
291 | 293 | | |||
292 | LabelWithToolTip { | 294 | LabelWithToolTip { | ||
293 | id: mainCompactLabel | 295 | id: mainCompactLabel | ||
294 | 296 | | |||
295 | text: title | 297 | text: displayTitle | ||
296 | 298 | | |||
297 | font.weight: (isPlaying ? Font.Bold : Font.Normal) | 299 | font.weight: (isPlaying ? Font.Bold : Font.Normal) | ||
298 | color: simpleMode ? myPalette.highlightedText : myPalette.text | 300 | color: simpleMode ? myPalette.highlightedText : myPalette.text | ||
299 | 301 | | |||
300 | Layout.maximumWidth: mainCompactLabel.implicitWidth + 1 | 302 | Layout.maximumWidth: mainCompactLabel.implicitWidth + 1 | ||
301 | Layout.fillWidth: true | 303 | Layout.fillWidth: true | ||
302 | Layout.alignment: Qt.AlignVCenter | Qt.AlignLeft | 304 | Layout.alignment: Qt.AlignVCenter | Qt.AlignLeft | ||
303 | 305 | | |||
304 | visible: isValid | 306 | visible: isValid | ||
305 | 307 | | |||
306 | elide: Text.ElideRight | 308 | elide: Text.ElideRight | ||
307 | horizontalAlignment: Text.AlignLeft | 309 | horizontalAlignment: Text.AlignLeft | ||
308 | } | 310 | } | ||
309 | 311 | | |||
310 | LabelWithToolTip { | 312 | LabelWithToolTip { | ||
311 | id: mainInvalidCompactLabel | 313 | id: mainInvalidCompactLabel | ||
312 | 314 | | |||
313 | text: title | 315 | text: displayTitle | ||
314 | 316 | | |||
315 | font.weight: Font.Normal | 317 | font.weight: Font.Normal | ||
316 | color: simpleMode ? myPalette.highlightedText : myPalette.text | 318 | color: simpleMode ? myPalette.highlightedText : myPalette.text | ||
317 | 319 | | |||
318 | Layout.fillWidth: true | 320 | Layout.fillWidth: true | ||
319 | Layout.alignment: Qt.AlignVCenter | Qt.AlignLeft | 321 | Layout.alignment: Qt.AlignVCenter | Qt.AlignLeft | ||
320 | 322 | | |||
321 | visible: !isValid | 323 | visible: !isValid | ||
▲ Show 20 Lines • Show All 169 Lines • Show Last 20 Lines |