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