Skip to content
Snippets Groups Projects
Commit b23f655d authored by Prince Gupta's avatar Prince Gupta :speech_balloon: Committed by Hugo Beauzée-Luyssen
Browse files

qml/MusicArtistsAlbums: support drag to playlist of Music Artists

parent e0e7911a
No related branches found
No related tags found
1 merge request!459qml: improves Music Artist view implementation
......@@ -207,6 +207,38 @@ FocusScope {
else
albumSubView.forceActiveFocus()
}
drag.axis: Drag.XAndYAxis
drag.target: Widgets.DragItem {
function updateComponents(maxCovers) {
return {
covers: [{artwork: model.cover || VLCStyle.noArtArtistSmall}],
title: model.name || i18n.qtr("Unknown artist"),
count: 1
}
}
function getSelectedInputItem() {
return artistModel.getItemsForIndexes([artistModel.index(index, 0)])
}
}
drag.onActiveChanged: {
var dragItem = drag.target
if (!drag.active)
dragItem.Drag.drop()
dragItem.Drag.active = drag.active
}
onPositionChanged: {
if (drag.active) {
var pos = drag.target.parent.mapFromItem(item, mouseX, mouseY)
drag.target.x = pos.x + 12
drag.target.y = pos.y + 12
}
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment