Compare commits

...
Author SHA1 Message Date
Dimitris Kardarakos 0ea2d757d7 Fix action naming and icon 2022-01-02 15:13:02 +02:00
Dimitris Kardarakos 93d7164229 Improve search page item accessibility
On mobile, interaction with the search page swipe list items result in a set of inconveniences:
- Accidentally play a track - triggered by item click- while trying to click the swipe handler, and vice versa
- Swipe list item actions do not offer a text description; you have to try them to see what they offer
- The styling of the swipe list item on mobile, in many cases, makes hard to trigger the actions
- When more than one pages exist in the stack, gestures for swiping an item and navigating between pages overlap

An alternative pattern is offered:
- The search results are presented as simple list items
- When the user clicks on an item, the item is expanded; a new row is displayed, displaying the actions available for this item.
- When the user clicks on an expanded item, the item's actions are hiding
2022-01-02 12:54:38 +00:00
Jonah Brüchert 135b8859d6 Fix typo in requirements.txt 2021-12-31 18:43:16 +01:00
Jonah Brüchert f8637b686c flatpak: Update yt-dlp 2021-12-31 18:17:32 +01:00
Jonah Brüchert 53f466c976 Update tested ytmusicapi version to 0.19.5 2021-12-21 12:53:38 +01:00
5 changed files with 76 additions and 58 deletions

No files matched your search

+7 -7
View File
@@ -7,8 +7,13 @@
"sources": [
{
"type": "file",
"url": "https://files.pythonhosted.org/packages/5e/2a/3cbe2e29926784d8718eb2f92357d7e22caf393f24e19287746076ffc9f2/yt_dlp-2021.11.10.1-py2.py3-none-any.whl",
"sha256": "9c3d85fdeeac3d61cfc85fd72d55fe6b63fcf1d19d05e2841cf2e544922ed157"
"url": "https://files.pythonhosted.org/packages/27/7e/5bf52a334a0638639b57b7699e6a3adaaaa8e7bd6f7ad33e62a9e2be7bb7/yt_dlp-2021.12.27-py2.py3-none-any.whl",
"sha256": "bb46898a175d149c9c6bb2846056590d297aa4eafad8487c3e1315d2c6090896"
},
{
"type": "file",
"url": "https://files.pythonhosted.org/packages/f6/06/e2ad9e93210790be86d36c6e2d5524ba54928c3ed27dd0be9b2ced7c57f1/pycryptodomex-3.12.0.zip",
"sha256": "922e9dac0166e4617e5c7980d2cff6912a6eb5cb5c13e7ece222438650bd7f66"
},
{
"type": "file",
@@ -19,11 +24,6 @@
"type": "file",
"url": "https://files.pythonhosted.org/packages/16/b3/f7aa8edf2ff4495116f95fd442b2a346aa55d1d46313143c8814886dbcdb/mutagen-1.45.1-py3-none-any.whl",
"sha256": "9c9f243fcec7f410f138cb12c21c84c64fde4195481a30c9bfb05b5f003adfed"
},
{
"type": "file",
"url": "https://files.pythonhosted.org/packages/47/14/dd9ad29cd29ea4cc521286f2cb401ca7ac6fd5db0791c5e9bacaf2c9ac78/pycryptodomex-3.11.0.tar.gz",
"sha256": "0398366656bb55ebdb1d1d493a7175fc48ade449283086db254ac44c7d318d6d"
}
]
}
+6 -6
View File
@@ -7,8 +7,8 @@
"sources": [
{
"type": "file",
"url": "https://files.pythonhosted.org/packages/7b/77/f341b20e7307f18ede4625867cbb8e18c20199117e0c23f7c6b53fe6597d/ytmusicapi-0.19.4-py3-none-any.whl",
"sha256": "d0e980b35cf290eae409dcdc6ee31c5c358b28baebf1052e9fc9f446fc7901b7"
"url": "https://files.pythonhosted.org/packages/87/5a/ef90afb6dbef7a2cf8418c050f2e9e32be449f97ddad085e41e568bf4a15/ytmusicapi-0.19.5-py3-none-any.whl",
"sha256": "23ed35df2b7977e3e7662c0ac478864fb23d025ba5de8f2c269cabf2903b8d25"
},
{
"type": "file",
@@ -17,13 +17,13 @@
},
{
"type": "file",
"url": "https://files.pythonhosted.org/packages/c8/27/141554fc0f42c05dd318fbb0be0e3e018da686544a3ff452762e49ccac58/charset_normalizer-2.0.8-py3-none-any.whl",
"sha256": "83fcdeb225499d6344c8f7f34684c2981270beacc32ede2e669e94f7fa544405"
"url": "https://files.pythonhosted.org/packages/37/45/946c02767aabb873146011e665728b680884cd8fe70dde973c640e45b775/certifi-2021.10.8-py2.py3-none-any.whl",
"sha256": "d62a0163eb4c2344ac042ab2bdf75399a71a2d8c7d47eac2e2ee91b9d6339569"
},
{
"type": "file",
"url": "https://files.pythonhosted.org/packages/37/45/946c02767aabb873146011e665728b680884cd8fe70dde973c640e45b775/certifi-2021.10.8-py2.py3-none-any.whl",
"sha256": "d62a0163eb4c2344ac042ab2bdf75399a71a2d8c7d47eac2e2ee91b9d6339569"
"url": "https://files.pythonhosted.org/packages/47/84/b06f6729fac8108c5fa3e13cde19b0b3de66ba5538c325496dbe39f5ff8e/charset_normalizer-2.0.9-py3-none-any.whl",
"sha256": "1eecaa09422db5be9e29d7fc65664e6c33bd06f9ced7838578ba40d58bdf3721"
},
{
"type": "file",
+2 -2
View File
@@ -3,5 +3,5 @@
#
# SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
ytmusicapi==0.19.4
ytdlp
ytmusicapi==0.19.5
yt-dlp
+60 -42
View File
@@ -75,8 +75,9 @@ Kirigami.ScrollablePage {
}
}
}
delegate: Kirigami.SwipeListItem {
delegate: Kirigami.AbstractListItem {
id: delegateItem
property bool showActionButtons: false
required property int index
required property string title
required property int type
@@ -84,55 +85,72 @@ Kirigami.ScrollablePage {
required property var artists
required property string radioPlaylistId
RowLayout {
Layout.fillHeight: true
Kirigami.Icon {
Layout.fillHeight: true
source: {
switch (type) {
case SearchModel.Artist:
return "view-media-artist"
case SearchModel.Album:
return "media-album-cover"
case SearchModel.Playlist:
return "view-media-playlist"
case SearchModel.Song:
return "emblem-music-symbolic"
case SearchModel.Video:
return "emblem-videos-symbolic"
ColumnLayout {
RowLayout {
Layout.fillWidth: true
Kirigami.Icon {
Layout.fillHeight: true
source: {
switch (type) {
case SearchModel.Artist:
return "view-media-artist"
case SearchModel.Album:
return "media-album-cover"
case SearchModel.Playlist:
return "view-media-playlist"
case SearchModel.Song:
return "emblem-music-symbolic"
case SearchModel.Video:
return "emblem-videos-symbolic"
}
}
}
Controls.Label {
Layout.fillWidth: true
text: title
elide: Qt.ElideRight
}
}
Controls.Label {
Kirigami.Separator {
visible: showActionButtons
Layout.fillWidth: true
text: title
elide: Qt.ElideRight
}
Kirigami.ActionToolBar {
Layout.fillWidth: true
alignment: Qt.AlignLeft
visible: showActionButtons
actions: [
Kirigami.Action {
icon.name: (delegateItem.type === SearchModel.Song || delegateItem.type == SearchModel.Video) ? "media-playback-start" : "project-open"
text: (delegateItem.type === SearchModel.Song || delegateItem.type == SearchModel.Video) ? i18n("Play") : i18n("Open")
onTriggered: searchModel.triggerItem(index)
} ,
Kirigami.Action {
icon.name: "go-next"
text: i18n("Play next")
visible: delegateItem.type === SearchModel.Song || delegateItem.type == SearchModel.Video
onTriggered: UserPlaylistModel.playNext(delegateItem.videoId, delegateItem.title, delegateItem.artists)
},
Kirigami.Action {
icon.name: "media-playlist-append"
text: i18n("Add to Playlist")
visible: delegateItem.type === SearchModel.Song || delegateItem.type == SearchModel.Video
onTriggered: UserPlaylistModel.append(delegateItem.videoId, delegateItem.title, delegateItem.artists)
},
Kirigami.Action {
icon.name: "radio"
text: i18n("Radio")
visible: delegateItem.type === SearchModel.Artist && delegateItem.radioPlaylistId
onTriggered: playPlaylist(delegateItem.radioPlaylistId)
}
]
}
}
actions: [
Kirigami.Action {
icon.name: "go-next"
text: i18n("Play next")
visible: delegateItem.type === SearchModel.Song || delegateItem.type == SearchModel.Video
onTriggered: UserPlaylistModel.playNext(delegateItem.videoId, delegateItem.title, delegateItem.artists)
},
Kirigami.Action {
icon.name: "media-playlist-append"
text: i18n("Add to Playlist")
visible: delegateItem.type === SearchModel.Song || delegateItem.type == SearchModel.Video
onTriggered: UserPlaylistModel.append(delegateItem.videoId, delegateItem.title, delegateItem.artists)
},
Kirigami.Action {
icon.name: "radio"
text: i18n("Radio")
visible: delegateItem.type === SearchModel.Artist && delegateItem.radioPlaylistId
onTriggered: playPlaylist(delegateItem.radioPlaylistId)
}
]
onClicked: searchModel.triggerItem(index)
onClicked: showActionButtons = !showActionButtons
}
Controls.BusyIndicator {
anchors.centerIn: parent
+1 -1
View File
@@ -21,7 +21,7 @@ void pyPrintPretty(py::handle obj) {
#define UNEXPORT __attribute__ ((visibility("hidden")))
constexpr auto TESTED_YTMUSICAPI_VERSION = "0.19.4";
constexpr auto TESTED_YTMUSICAPI_VERSION = "0.19.5";
struct UNEXPORT YTMusicPrivate {
py::scoped_interpreter guard {};