Fix keyboard scrolling when kinetic is disabled

This commit is contained in:
miruka 2021-01-04 11:00:14 -04:00
parent 56459a0d3d
commit 8175bbde0e
2 changed files with 6 additions and 1 deletions

View File

@ -63,7 +63,7 @@ MouseArea {
} }
} }
enabled: ! window.settings.Scrolling.kinetic enabled: ! window.settings.Scrolling.kinetic && ! utils.keyboardFlicking
propagateComposedEvents: true propagateComposedEvents: true
acceptedButtons: Qt.NoButton acceptedButtons: Qt.NoButton

View File

@ -8,6 +8,7 @@ QtObject {
enum Media { Page, File, Image, Video, Audio } enum Media { Page, File, Image, Video, Audio }
property QtObject theme: null property QtObject theme: null
property bool keyboardFlicking: false
readonly property var imageExtensions: [ readonly property var imageExtensions: [
"bmp", "gif", "jpg", "jpeg", "png", "pbm", "pgm", "ppm", "xbm", "xpm", "bmp", "gif", "jpg", "jpeg", "png", "pbm", "pgm", "ppm", "xbm", "xpm",
@ -415,6 +416,8 @@ QtObject {
// If this is a repeated flicking, flick faster than a single flick. // If this is a repeated flicking, flick faster than a single flick.
if (! flickable.interactive) return if (! flickable.interactive) return
keyboardFlicking = true
const futureVelocity = const futureVelocity =
(horizontal ? -flickable.width : -flickable.height) * pages (horizontal ? -flickable.width : -flickable.height) * pages
@ -448,6 +451,8 @@ QtObject {
flickable.maximumFlickVelocity = normalMaxSpeed flickable.maximumFlickVelocity = normalMaxSpeed
flickable.flickDeceleration = normalDecel flickable.flickDeceleration = normalDecel
keyboardFlicking = false
} }