Commit 219ef4fb authored by Nate Graham's avatar Nate Graham 💤
Browse files

Move remaining track indicator to playlist footer

Right now it can overlap with the text in the HeaderBar. And its
current location there feels kind of random, like it's just floating
in space, unstructured. By moving it to the playlist's footer, we solve
both of those problems and also give it in a more logical home:
alongside the indicator of the total number of tracks. Now the footer
shows two related pieces of information: the total number of tracks,
the the number of remaining tracks.

BUG: 429464
FIXED-IN: 21.04
parent 9034ae25
Pipeline #43543 passed with stage
in 9 minutes and 25 seconds
......@@ -212,7 +212,6 @@ Kirigami.ApplicationWindow {
Layout.maximumHeight: mainWindow.height * 0.2 + elisaTheme.mediaPlayerControlHeight
Layout.fillWidth: true
tracksCount: ElisaApplication.mediaPlayListProxyModel.remainingTracks
album: (ElisaApplication.manageHeaderBar.album !== undefined ? ElisaApplication.manageHeaderBar.album : '')
title: ElisaApplication.manageHeaderBar.title
artist: (ElisaApplication.manageHeaderBar.artist !== undefined ? ElisaApplication.manageHeaderBar.artist : '')
......
......@@ -22,7 +22,6 @@ FocusScope {
property string image
property string newImage
property string oldImage
property int tracksCount
property int trackRating
property int albumID
property bool ratingVisible
......@@ -360,43 +359,6 @@ FocusScope {
}
}
LabelWithToolTip {
id: remainingTracksLabel
// Not inside a layout because we don't want it to cause items to
// get re-arranged when it changes visibility
anchors.left: parent.left
anchors.bottom: playControlItem.top
anchors.margins: Kirigami.Units.smallSpacing
opacity: tracksCount >= 0 ? 1.0 : 0.0
visible: opacity > 0
text: {
if (tracksCount < 0) {
return text;
}
if (tracksCount > 0) {
return i18np("1 track remaining", "%1 tracks remaining", tracksCount)
}
return i18n("No remaining tracks");
}
elide: Text.ElideRight
// Hardcoded because the headerbar blur always makes a dark-ish
// background, so we don't want to use a color scheme color that
// might also be dark
color: "white"
Behavior on opacity {
OpacityAnimator {
duration: Kirigami.Units.shortDuration
}
}
}
SequentialAnimation {
id: changeBackgroundTransition
......
......@@ -246,12 +246,17 @@ FocusScope {
Layout.preferredHeight: Kirigami.Units.gridUnit * 2
contentItems: [
LabelWithToolTip {
id: trackCountLabel
Layout.fillWidth: true
text: i18np("%1 track", "%1 tracks", (ElisaApplication.mediaPlayListProxyModel ? ElisaApplication.mediaPlayListProxyModel.tracksCount : 0))
elide: Text.ElideLeft
},
Item {
Layout.fillWidth: true
},
LabelWithToolTip {
visible: ElisaApplication.mediaPlayListProxyModel.remainingTracks != -1
text: ElisaApplication.mediaPlayListProxyModel.remainingTracks == 0 ? i18n("Last track") : i18ncp("Number of remaining tracks in a playlist of songs", "%1 remaining", "%1 remaining", ElisaApplication.mediaPlayListProxyModel.remainingTracks)
elide: Text.ElideRight
}
]
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment