Skip to content
Snippets Groups Projects
Commit 443a2a4e authored by Fatih Uzunoğlu's avatar Fatih Uzunoğlu Committed by Jean-Baptiste Kempf
Browse files

qml: intelligently show drop indicator in medialibrary playlist

parent 55fecf72
No related branches found
No related tags found
1 merge request!3902qml: intelligently show drop indicator in medialibrary playlist
Pipeline #401035 passed with stages
in 32 minutes and 3 seconds
......@@ -142,13 +142,16 @@ MainInterface.MainTableView {
//---------------------------------------------------------------------------------------------
// Drop interface
function isDroppable(drop) {
// NOTE: Internal drop (intra-playlist).
return Helpers.isValidInstanceOf(drop.source, Widgets.DragItem);
function isDroppable(drop, index) {
if (drop.source === dragItem) {
return Helpers.itemsMovable(selectionModel.sortedSelectedIndexesFlat, index)
} else {
return Helpers.isValidInstanceOf(drop.source, Widgets.DragItem)
}
}
function applyDrop(drop, index, delegate, before) {
if (root.isDroppable(drop) === false) {
if (root.isDroppable(drop, index + (before ? 0 : 1)) === false) {
root.hideLine(delegate)
return
}
......@@ -174,7 +177,7 @@ MainInterface.MainTableView {
}
function _dropUpdatePosition(drag, index, delegate, before) {
if (root.isDroppable(drag) === false) {
if (root.isDroppable(drag, index + (before ? 0 : 1)) === false) {
root.hideLine(delegate)
return
}
......
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