Make page scrolling less slippery

This commit is contained in:
miruka 2019-09-06 17:03:52 -04:00
parent 14e01159c6
commit 0651fbd100
2 changed files with 6 additions and 3 deletions

View File

@ -13,7 +13,7 @@ ListView {
preferredHighlightBegin: height / 2 - currentItemHeight
preferredHighlightEnd: height / 2 + currentItemHeight
maximumFlickVelocity: 5000
maximumFlickVelocity: 4000
property bool enableFlicking: true

View File

@ -41,17 +41,20 @@ HShortcutHandler {
HShortcut {
sequences: settings.keys.scrollPageUp
onPressed: Utils.smartVerticalFlick(
flickTarget, -2.3 * flickTarget.height, 10,
flickTarget, -2.3 * flickTarget.height, 8,
)
onHeld: pressed(event)
// Ensure only a slight slip after releasing the key
onReleased: Utils.smartVerticalFlick(flickTarget, -335)
}
HShortcut {
sequences: settings.keys.scrollPageDown
onPressed: Utils.smartVerticalFlick(
flickTarget, 2.3 * flickTarget.height, 10,
flickTarget, 2.3 * flickTarget.height, 8,
)
onHeld: pressed(event)
onReleased: Utils.smartVerticalFlick(flickTarget, 335)
}
HShortcut {