]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/dolphinviewautoscroller.cpp
Disable additional properties per default as discussed with Sebastian TrĂ¼g.
[dolphin.git] / src / dolphinviewautoscroller.cpp
index 10bdebe3d9164b91553d2739d070478056ef03b6..75dab3214cb6f28a52dd20bd2f0f019e58b2a74a 100644 (file)
@@ -26,6 +26,7 @@
 #include <QMouseEvent>
 #include <QScrollBar>
 #include <QTimer>
+#include <math.h>
 
 DolphinViewAutoScroller::DolphinViewAutoScroller(QAbstractItemView* parent) :
     QObject(parent),
@@ -160,18 +161,18 @@ int DolphinViewAutoScroller::calculateScrollIncrement(int cursorPos, int rangeSi
 {
     int inc = 0;
 
-    const int minSpeed = 2;
-    const int maxSpeed = 32;
-    const int speedLimiter = 8;
-    const int autoScrollBorder = 32;
+    const int minSpeed = 4;
+    const int maxSpeed = 768;
+    const int speedLimiter = 48;
+    const int autoScrollBorder = 64;
 
     if (cursorPos < autoScrollBorder) {
-        inc = -minSpeed + (cursorPos - autoScrollBorder) / speedLimiter;
+        inc = -minSpeed + qAbs(cursorPos - autoScrollBorder) * (cursorPos - autoScrollBorder) / speedLimiter;
         if (inc < -maxSpeed) {
             inc = -maxSpeed;
         }
     } else if (cursorPos > rangeSize - autoScrollBorder) {
-        inc = minSpeed + (cursorPos - rangeSize + autoScrollBorder) / speedLimiter;
+        inc = minSpeed + qAbs(cursorPos - rangeSize + autoScrollBorder) * (cursorPos - rangeSize + autoScrollBorder) / speedLimiter;
         if (inc > maxSpeed) {
             inc = maxSpeed;
         }