From 874bc595e319f18826e3210b081a96b9e31cdd56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luis=20=C3=81ngel=20San=20Mart=C3=ADn?= Date: Sat, 9 Apr 2016 18:52:12 +0200 Subject: [PATCH] Improved wheel mouse scrolling in FlowView.qml --- YACReaderLibrary/qml/FlowView.qml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/YACReaderLibrary/qml/FlowView.qml b/YACReaderLibrary/qml/FlowView.qml index e06bf864..cb1c9a80 100644 --- a/YACReaderLibrary/qml/FlowView.qml +++ b/YACReaderLibrary/qml/FlowView.qml @@ -52,9 +52,13 @@ Rectangle { MouseArea { anchors.fill : list onWheel: { + + if(list.moving) + return; + var ci if(wheel.angleDelta.y < 0) { - ci = Math.min(list.currentIndex+1, list.count); + ci = Math.min(list.currentIndex+1, list.count - 1); } else if(wheel.angleDelta.y > 0) { ci = Math.max(0,list.currentIndex-1); @@ -86,6 +90,8 @@ Rectangle { highlightRangeMode: ListView.StrictlyEnforceRange preferredHighlightEnd: 50 + highlightMoveDuration: 250 + delegate: Component { //cover @@ -168,11 +174,12 @@ Rectangle { focus: true Keys.onPressed: { + if (event.modifiers & Qt.ControlModifier || event.modifiers & Qt.ShiftModifier) return; var ci if (event.key === Qt.Key_Right) { - ci = Math.min(list.currentIndex+1, list.count); + ci = Math.min(list.currentIndex+1, list.count - 1); } else if (event.key === Qt.Key_Left) { ci = Math.max(0,list.currentIndex-1);