feat(qbz-qt): phase 17 — PlaylistView 1:1 + drag & drop as Slint
Full playlist surface: header with owner/foreign gating, play/shuffle, favorite/follow optimistic, copy-to-library, pin, rename, delete, per-row remove for owners, search filter, full sort set, custom-order drag reorder persisted per user. Sidebar and every playlist card navigate; card overlay/menu actions un-stubbed. Drag & drop per the Slint gesture: row-body press-drag (>6px) from album/playlist/search/ library rows, window-top ghost pill, sidebar playlist rows drop-hot highlight, drop -> add_tracks_to_playlist + reload reconcile; in-list release reorders. Round-trip proven end-to-end on a throwaway playlist (create -> drag -> drop -> refetch shows track -> delete). km
This commit is contained in:
28 files changed
+2365
-17
No files matched your search
@@ -807,8 +807,8 @@ Rectangle {
|
||||
anchors.fill: parent
|
||||
hoverEnabled: true
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
// body-opens (Favorites convention): the playlist page is
|
||||
// out of scope (POC-NOTE — inert).
|
||||
// body-opens (Favorites convention).
|
||||
onClicked: QbzBridge.openPlaylist(item.id)
|
||||
}
|
||||
Row {
|
||||
y: 120
|
||||
@@ -829,6 +829,9 @@ Rectangle {
|
||||
if (item.playlistOwned) {
|
||||
item.isFavorite = !item.isFavorite
|
||||
QbzBridge.libraryToggleFavorite("playlist", item.id)
|
||||
} else {
|
||||
item.playlistFollowing = !item.playlistFollowing
|
||||
QbzBridge.playlistSetFollowById(item.id, item.playlistFollowing)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -837,8 +840,7 @@ Rectangle {
|
||||
name: "play-fill"
|
||||
primary: true
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
// POC-NOTE: playlist play (playlist queue builder) out
|
||||
// of scope — inert.
|
||||
onClicked: QbzBridge.playPlaylistById(item.id)
|
||||
}
|
||||
LibOverlayBtn {
|
||||
id: plMore
|
||||
@@ -868,12 +870,20 @@ Rectangle {
|
||||
"action": "favorite" },
|
||||
]
|
||||
onPicked: function (a) {
|
||||
if (a === "favorite") {
|
||||
if (a === "play") QbzBridge.playPlaylistById(item.id)
|
||||
else if (a === "play-next") QbzBridge.enqueuePlaylistById(item.id, "next")
|
||||
else if (a === "play-later") QbzBridge.enqueuePlaylistById(item.id, "later")
|
||||
else if (a === "queue") QbzBridge.enqueuePlaylistById(item.id, "queue")
|
||||
else if (a === "favorite") {
|
||||
if (item.playlistOwned) {
|
||||
item.isFavorite = !item.isFavorite
|
||||
QbzBridge.libraryToggleFavorite("playlist", item.id)
|
||||
} else {
|
||||
// Foreign playlist: follow/unfollow on Qobuz
|
||||
// (subscribe API; optimistic flip).
|
||||
item.playlistFollowing = !item.playlistFollowing
|
||||
QbzBridge.playlistSetFollowById(item.id, item.playlistFollowing)
|
||||
}
|
||||
// follow/unfollow: inert (POC-NOTE).
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1232,12 +1242,34 @@ Rectangle {
|
||||
radius: 6
|
||||
color: trRowArea.containsMouse ? theme.surfaceHover : "transparent"
|
||||
|
||||
property bool dragging: false
|
||||
property point downPos: Qt.point(0, 0)
|
||||
MouseArea {
|
||||
id: trRowArea
|
||||
anchors.fill: parent
|
||||
hoverEnabled: true
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
onClicked: QbzBridge.playTrack(item.id)
|
||||
onPressed: function (mouse) { parent.downPos = Qt.point(mouse.x, mouse.y) }
|
||||
onPositionChanged: function (mouse) {
|
||||
if (!pressed) return
|
||||
const g = mapToItem(null, mouse.x, mouse.y)
|
||||
if (!parent.dragging
|
||||
&& (Math.abs(mouse.x - parent.downPos.x) > 6
|
||||
|| Math.abs(mouse.y - parent.downPos.y) > 6)) {
|
||||
parent.dragging = true
|
||||
QbzBridge.dragStart(item.id, item.title,
|
||||
item.artist + " · " + item.album, g.x, g.y)
|
||||
}
|
||||
if (parent.dragging) QbzBridge.dragMove(g.x, g.y)
|
||||
}
|
||||
onReleased: function (mouse) {
|
||||
if (parent.dragging) {
|
||||
QbzBridge.dragEnd()
|
||||
parent.dragging = false
|
||||
} else {
|
||||
QbzBridge.playTrack(item.id)
|
||||
}
|
||||
}
|
||||
}
|
||||
Row {
|
||||
anchors.fill: parent
|
||||
|
||||
Reference in new issue
Block a user