]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/kitemviews/kitemlistcontainer.cpp
GIT_SILENT Upgrade KDE Applications version to 15.11.80.
[dolphin.git] / src / kitemviews / kitemlistcontainer.cpp
index 46ac4745e70fa6ab9c3825fe7e6b5f67ed7846e7..c9d521ce788fabab56ea6ca943a14174bee9bc14 100644 (file)
@@ -35,7 +35,6 @@
 #include <QStyle>
 #include <QStyleOption>
 
-#include <KDebug>
 
 /**
  * Replaces the default viewport of KItemListContainer by a
@@ -187,11 +186,21 @@ void KItemListContainer::wheelEvent(QWheelEvent* event)
     const QScrollBar* scrollBar = smoothScroller->scrollBar();
     if (!event->pixelDelta().isNull()) {
         const int numPixels =  event->pixelDelta().y();
-        smoothScroller->scrollTo(scrollBar->value() - numPixels);
+        if (event->modifiers().testFlag(Qt::ShiftModifier)) {
+            const int scrollingDirection = numPixels > 0 ? 1 : -1;
+            smoothScroller->scrollTo(scrollBar->value() - scrollBar->pageStep() * scrollingDirection);
+        } else {
+            smoothScroller->scrollTo(scrollBar->value() - numPixels);
+        }
     } else {
         const int numDegrees = event->angleDelta().y() / 8;
         const int numSteps = numDegrees / 15;
-        smoothScroller->scrollTo(scrollBar->value() - numSteps * scrollBar->pageStep() / 4);
+        if (event->modifiers().testFlag(Qt::ShiftModifier)) {
+            const int scrollingDirection = numSteps > 0 ? 1 : -1;
+            smoothScroller->scrollTo(scrollBar->value() - scrollBar->pageStep() * scrollingDirection);
+        } else {
+            smoothScroller->scrollTo(scrollBar->value() - numSteps * scrollBar->pageStep() / 4);
+        }
     }
 
     event->accept();