From: Marcel Partap Date: Thu, 4 Jun 2009 22:28:52 +0000 (+0000) Subject: Further pimpage of auto scrolling: make it quadratic! Better scales to HUGE file... X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/commitdiff_plain/d34036152b86d86d1dabe2d719d5abe1e6f205a5?ds=inline Further pimpage of auto scrolling: make it quadratic! Better scales to HUGE file lists now. Thx peter for the hint ;) CCBUG: 194235 svn path=/trunk/KDE/kdebase/apps/; revision=977658 --- diff --git a/src/dolphinviewautoscroller.cpp b/src/dolphinviewautoscroller.cpp index c5d5e47d7..4e7af7f59 100644 --- a/src/dolphinviewautoscroller.cpp +++ b/src/dolphinviewautoscroller.cpp @@ -26,6 +26,7 @@ #include #include #include +#include DolphinViewAutoScroller::DolphinViewAutoScroller(QAbstractItemView* parent) : QObject(parent), @@ -161,17 +162,17 @@ int DolphinViewAutoScroller::calculateScrollIncrement(int cursorPos, int rangeSi int inc = 0; const int minSpeed = 4; - const int maxSpeed = 64; - const int speedLimiter = 4; - const int autoScrollBorder = 32; + const int maxSpeed = 768; + const int speedLimiter = 48; + const int autoScrollBorder = 64; if (cursorPos < autoScrollBorder) { - inc = -minSpeed + (cursorPos - autoScrollBorder) / speedLimiter; + inc = -minSpeed + fabs(cursorPos - autoScrollBorder) * (cursorPos - autoScrollBorder) / speedLimiter; if (inc < -maxSpeed) { inc = -maxSpeed; } } else if (cursorPos > rangeSize - autoScrollBorder) { - inc = minSpeed + (cursorPos - rangeSize + autoScrollBorder) / speedLimiter; + inc = minSpeed + fabs(cursorPos - rangeSize + autoScrollBorder) * (cursorPos - rangeSize + autoScrollBorder) / speedLimiter; if (inc > maxSpeed) { inc = maxSpeed; }