From ad8c9d55dcdba539b0120b56c1944c6b9cf31073 Mon Sep 17 00:00:00 2001 From: miruka Date: Tue, 21 Jul 2020 23:53:56 -0400 Subject: [PATCH] Raise max flicking speed while keyboard-scrolling Lets holding the page down/up keybinds properly do their job again --- TODO.md | 1 - src/gui/Utils.qml | 12 ++++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/TODO.md b/TODO.md index 18220ce1..13c638cb 100644 --- a/TODO.md +++ b/TODO.md @@ -6,7 +6,6 @@ - Avatar tooltip can get displayed in front of presence menu - Use loading cursorShape -- Increase keyboard page scroll speed - global presence control diff --git a/src/gui/Utils.qml b/src/gui/Utils.qml index e05cc88e..7c5815cd 100644 --- a/src/gui/Utils.qml +++ b/src/gui/Utils.qml @@ -432,11 +432,14 @@ QtObject { (futureVelocity < 0 && currentVelocity < futureVelocity / 2) || (futureVelocity > 0 && currentVelocity > futureVelocity / 2) - const magicNumber = 2.5 - const normalDecel = flickable.flickDeceleration - const fastMultiply = + const magicNumber = 2.5 + const normalDecel = flickable.flickDeceleration + const normalMaxSpeed = flickable.maximumFlickVelocity + const fastMultiply = pages && multiplier / (1 - Math.log10(Math.abs(pages))) + flickable.maximumFlickVelocity = 5000 + flickable.flickDeceleration = Math.max( goFaster ? normalDecel : -Infinity, Math.abs(normalDecel * magicNumber * pages), @@ -447,7 +450,8 @@ QtObject { horizontal ? flickable.flick(flick, 0) : flickable.flick(0, flick) - flickable.flickDeceleration = normalDecel + flickable.maximumFlickVelocity = normalMaxSpeed + flickable.flickDeceleration = normalDecel }