Prevent non-left buttons from drag-scrolling

This commit is contained in:
miruka 2019-09-01 05:19:41 -04:00
parent 24a976e3ee
commit e6a133598f

View File

@ -13,6 +13,7 @@ Rectangle {
reversed: eventList.verticalLayoutDirection == ListView.BottomToTop
onDragPositionChanged: {
let left = dragPoint.pressedButtons & Qt.LeftButton
let vel = dragPoint.velocity.y
let boost = 20 * (
@ -22,8 +23,8 @@ Rectangle {
dragFlicker.speed =
dragPosition.x == 0 && dragPosition.y == 0 ? 0 :
vel && dragPosition.y < 50 ? 1000 + boost:
vel && dragPosition.y > height - 50 ? -1000 + -boost :
left && vel && dragPosition.y < 50 ? 1000 + boost:
left && vel && dragPosition.y > height - 50 ? -1000 + -boost :
0
}