support auto scroll with actual dnd

This commit is contained in:
Marco Martin 2021-03-25 12:50:04 +01:00
parent dff5809c59
commit e27b45574c
2 changed files with 12 additions and 1 deletions

View file

@ -47,7 +47,7 @@ Flickable {
onFlickStarted: cancelEditModeForItemsRequested()
onFlickEnded: cancelEditModeForItemsRequested()
onCurrentIndexChanged: contentX = width * currentIndex;
//onCurrentIndexChanged: contentX = width * currentIndex;
onContentXChanged: mainFlickable.currentIndex = Math.floor(contentX / width)

View file

@ -144,6 +144,17 @@ FocusScope {
appletsLayout.defaultItemHeight)
);
launcherDragManager.hideSpacer();
//SCROLL LEFT
if (event.x < units.gridUnit) {
mainFlickable.scrollLeft();
//SCROLL RIGHT
} else if (event.x > mainFlickable.width - units.gridUnit) {
mainFlickable.scrollRight();
//DON't SCROLL
} else {
mainFlickable.stopScroll();
}
}
}