diff options
| author | Marcel Partap <[email protected]> | 2009-06-04 22:28:52 +0000 |
|---|---|---|
| committer | Marcel Partap <[email protected]> | 2009-06-04 22:28:52 +0000 |
| commit | d34036152b86d86d1dabe2d719d5abe1e6f205a5 (patch) | |
| tree | aa27e0fe75f003e68ad6791c13adceadf59fec8f /src | |
| parent | d339cb83fe35e9d02e37085acb2465b23a305d03 (diff) | |
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
Diffstat (limited to 'src')
| -rw-r--r-- | src/dolphinviewautoscroller.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
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 <QMouseEvent> #include <QScrollBar> #include <QTimer> +#include <math.h> 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; } |
