hoping to fix the moving items in leftdock

This commit is contained in:
Chris Cochrun 2022-08-25 05:48:55 -05:00
parent 16b068e884
commit 19c7e4cd40
2 changed files with 19 additions and 27 deletions

View file

@ -59,6 +59,7 @@ ColumnLayout {
clip: true
spacing: 3
property int indexDragged
property int moveToIndex
property int draggedY
addDisplaced: Transition {
@ -255,24 +256,11 @@ ColumnLayout {
}
function updateDrag(y) {
var newIndex;
print(serviceItemList.indexAt(0,y));
serviceItemList.draggedY = y;
if (y < 30) {
indexedHLRec.y = 0;
newIndex = 0;
moveRequested(indexDragged, newIndex)
}
else if (y < 80) {
indexedHLRec.y = 50;
newIndex = 1;
moveRequested(indexDragged, newIndex)
}
else if (y < 130) {
indexedHLRec.y = 100;
newIndex = 2;
moveRequested(indexDragged, newIndex)
}
if (moveToIndex === serviceItemList.indexAt(0,y))
return;
else
moveToIndex = serviceItemList.indexAt(0,y);
moveRequested(indexDragged, moveToIndex);
}
function moveRequested(oldIndex, newIndex) {