From e6a133598f08d2c4f0a10f4799effaebb99b049c Mon Sep 17 00:00:00 2001 From: miruka Date: Sun, 1 Sep 2019 05:19:41 -0400 Subject: [PATCH] Prevent non-left buttons from drag-scrolling --- src/qml/Chat/Timeline/EventList.qml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/qml/Chat/Timeline/EventList.qml b/src/qml/Chat/Timeline/EventList.qml index 8c1f436f..2426ba9c 100644 --- a/src/qml/Chat/Timeline/EventList.qml +++ b/src/qml/Chat/Timeline/EventList.qml @@ -13,7 +13,8 @@ Rectangle { reversed: eventList.verticalLayoutDirection == ListView.BottomToTop onDragPositionChanged: { - let vel = dragPoint.velocity.y + let left = dragPoint.pressedButtons & Qt.LeftButton + let vel = dragPoint.velocity.y let boost = 20 * ( dragPosition.y < 50 ? @@ -21,9 +22,9 @@ Rectangle { ) dragFlicker.speed = - dragPosition.x == 0 && dragPosition.y == 0 ? 0 : - vel && dragPosition.y < 50 ? 1000 + boost: - vel && dragPosition.y > height - 50 ? -1000 + -boost : + dragPosition.x == 0 && dragPosition.y == 0 ? 0 : + left && vel && dragPosition.y < 50 ? 1000 + boost: + left && vel && dragPosition.y > height - 50 ? -1000 + -boost : 0 }