Commit 2667a647 authored by Tranter Madi's avatar Tranter Madi 🌧 Committed by Nate Graham
Browse files

Make Shuffle/Repeat modes more clear

Currently the buttons are a bit confusing. This commit clarifies their tooltip text and also
uses the checked state when either of the modes are active.

BUG: 436217
FIXED-IN: 21.08
parent 9713eb29
Pipeline #59930 passed with stage
in 8 minutes and 56 seconds
......@@ -122,17 +122,18 @@ BasePlayerControl {
FlatButtonWithToolTip {
id: shuffleButton
text: i18nc("toggle shuffle mode for playlist", "Toggle Shuffle")
icon.name: musicWidget.shuffle ? "media-playlist-shuffle" : "media-playlist-normal"
icon.name: "media-playlist-shuffle"
onClicked: musicWidget.shuffle = !musicWidget.shuffle
checked: musicWidget.shuffle
}
FlatButtonWithToolTip {
id: repeatButton
text: {
const map = {
0: i18n("Don't repeat tracks"),
1: i18n("Repeat current track"),
2: i18n("Repeat all tracks in playlist")
0: i18n("Current: Don't repeat tracks"),
1: i18n("Current: Repeat current track"),
2: i18n("Current: Repeat all tracks in playlist")
}
return map[musicWidget.repeat]
}
......@@ -144,6 +145,7 @@ BasePlayerControl {
}
return map[musicWidget.repeat]
}
checked: repeat !== 0
onClicked: {
let nextRepeat = musicWidget.repeat + 1
if (nextRepeat >= 3) {
......
......@@ -212,9 +212,10 @@ BasePlayerControl {
Layout.maximumWidth: height
Layout.preferredWidth: height
text: i18nc("toggle shuffle mode for playlist", "Toggle Shuffle")
icon.name: trackPlayer.shuffle ? "media-playlist-shuffle" : "media-playlist-normal"
icon.name: "media-playlist-shuffle"
icon.color: "white"
onClicked: trackPlayer.shuffle = !trackPlayer.shuffle
checked: trackPlayer.shuffle
}
FlatButtonWithToolTip {
......@@ -225,11 +226,11 @@ BasePlayerControl {
Layout.preferredWidth: height
text: {
const map = {
0: i18n("Don't repeat tracks"),
1: i18n("Repeat current track"),
2: i18n("Repeat all tracks in playlist")
0: i18n("Current: Don't repeat tracks"),
1: i18n("Current: Repeat current track"),
2: i18n("Current: Repeat all tracks in playlist")
}
return map[trackPlayer.repeat]
return map[musicWidget.repeat]
}
icon.name: {
const map = {
......@@ -240,6 +241,7 @@ BasePlayerControl {
return map[trackPlayer.repeat]
}
icon.color: "white"
checked: repeat !== 0
onClicked: {
let nextRepeat = trackPlayer.repeat + 1
if (nextRepeat >= 3) {
......
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