Commit 0b7212ba authored by Nate Graham's avatar Nate Graham
Browse files

Don't use icons-only buttons in the Playlist

Icons-Only buttons are known to have sub-par usability, especially those
whose icons are not 100% universally recognizable (e.g. trashcan, plus
sign). Elisa's Playlist currently has a row of four icons-only buttons,
at least one of which has an incomprehensible icon. We can clean this up
by by rearranging the layout to move half the buttons to the footer,
which leaves room for all the buttons to get text.

This new positioning makes sense because each group of buttons now has a
logical grouping: the header buttons are both about the plsylist, which
is reflected in the "Playlist" label to their left. And the footer
buttons are all about tracks, which is reinforced by the label about
tracks to their left. No additional space is consumed in the process,
because now the addiitonal spac eis simply used more appropriately.

A Kirigami.ActionToolBar is used for both the header and footer toolbar,
so that the buttons will become icons-only again as needed if there is
not enough room to display all the text due to limited horizontal space
or long translated text in some languages.
parent 40a0168f
Pipeline #76541 passed with stage
in 8 minutes and 12 seconds
......@@ -141,22 +141,11 @@ Kirigami.Page {
alignment: Qt.AlignRight
actions: [
Kirigami.Action {
text: i18nc("Show currently played track inside playlist", "Show Current Track")
icon.name: 'media-track-show-active'
displayHint: Kirigami.DisplayHint.KeepVisible | Kirigami.DisplayHint.IconOnly
enabled: ElisaApplication.mediaPlayListProxyModel ? ElisaApplication.mediaPlayListProxyModel.tracksCount > 0 : false
onTriggered: {
playListView.positionViewAtIndex(ElisaApplication.mediaPlayListProxyModel.currentTrackRow, ListView.Contain)
playListView.currentIndex = ElisaApplication.mediaPlayListProxyModel.currentTrackRow
playListView.currentItem.forceActiveFocus()
}
},
Kirigami.Action {
id: savePlaylistButton
text: i18nc("Save a playlist file", "Save Playlist...")
text: i18nc("Save a playlist file", "Save...")
icon.name: 'document-save'
displayHint: Kirigami.DisplayHint.KeepVisible | Kirigami.DisplayHint.IconOnly
displayHint: Kirigami.DisplayHint.KeepVisible
enabled: ElisaApplication.mediaPlayListProxyModel ? ElisaApplication.mediaPlayListProxyModel.tracksCount > 0 : false
onTriggered: {
fileDialog.fileMode = PlatformDialog.FileDialog.SaveFile
......@@ -166,21 +155,14 @@ Kirigami.Page {
},
Kirigami.Action {
id: loadPlaylistButton
text: i18nc("Load a playlist file", "Load Playlist...")
text: i18nc("Load a playlist file", "Load...")
icon.name: 'document-open'
displayHint: Kirigami.DisplayHint.KeepVisible | Kirigami.DisplayHint.IconOnly
displayHint: Kirigami.DisplayHint.KeepVisible
onTriggered: {
fileDialog.fileMode = PlatformDialog.FileDialog.OpenFile
fileDialog.file = ''
fileDialog.open()
}
},
Kirigami.Action {
text: i18nc("Remove all tracks from play list", "Clear Playlist")
icon.name: 'edit-clear-all'
displayHint: Kirigami.DisplayHint.KeepVisible | Kirigami.DisplayHint.IconOnly
enabled: ElisaApplication.mediaPlayListProxyModel ? ElisaApplication.mediaPlayListProxyModel.tracksCount > 0 : false
onTriggered: ElisaApplication.mediaPlayListProxyModel.clearPlayList()
}
]
}
......@@ -511,17 +493,36 @@ Kirigami.Page {
anchors.fill: parent
LabelWithToolTip {
text: i18np("%1 track", "%1 tracks", (ElisaApplication.mediaPlayListProxyModel ? ElisaApplication.mediaPlayListProxyModel.tracksCount : 0))
text: ElisaApplication.mediaPlayListProxyModel.remainingTracks != -1 ?
i18np("%1 track", "%1 tracks (%2 remaining)", (ElisaApplication.mediaPlayListProxyModel ? ElisaApplication.mediaPlayListProxyModel.tracksCount : 0), ElisaApplication.mediaPlayListProxyModel.remainingTracks) :
i18np("%1 track", "%1 tracks", (ElisaApplication.mediaPlayListProxyModel ? ElisaApplication.mediaPlayListProxyModel.tracksCount : 0))
elide: Text.ElideLeft
}
Item {
Kirigami.ActionToolBar {
Layout.fillWidth: true
}
LabelWithToolTip {
visible: ElisaApplication.mediaPlayListProxyModel.remainingTracks != -1
alignment: Qt.AlignRight
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
actions: [
Kirigami.Action {
text: i18nc("Show currently played track inside playlist", "Show Current")
icon.name: 'media-track-show-active'
displayHint: Kirigami.DisplayHint.KeepVisible
enabled: ElisaApplication.mediaPlayListProxyModel ? ElisaApplication.mediaPlayListProxyModel.tracksCount > 0 : false
onTriggered: {
playListView.positionViewAtIndex(ElisaApplication.mediaPlayListProxyModel.currentTrackRow, ListView.Contain)
playListView.currentIndex = ElisaApplication.mediaPlayListProxyModel.currentTrackRow
playListView.currentItem.forceActiveFocus()
}
},
Kirigami.Action {
text: i18nc("Remove all tracks from play list", "Clear All")
icon.name: 'edit-clear-all'
displayHint: Kirigami.DisplayHint.KeepVisible
enabled: ElisaApplication.mediaPlayListProxyModel ? ElisaApplication.mediaPlayListProxyModel.tracksCount > 0 : false
onTriggered: ElisaApplication.mediaPlayListProxyModel.clearPlayList()
}
]
}
}
}
......
Supports Markdown
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