]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/kitemviews/kitemlistcontainer.cpp
Fix includes
[dolphin.git] / src / kitemviews / kitemlistcontainer.cpp
index 39e62962e206c337a00dfa331549f3911f56b4c4..46ac4745e70fa6ab9c3825fe7e6b5f67ed7846e7 100644 (file)
@@ -31,7 +31,6 @@
 #include <QApplication>
 #include <QGraphicsScene>
 #include <QGraphicsView>
-#include <QPropertyAnimation>
 #include <QScrollBar>
 #include <QStyle>
 #include <QStyleOption>
@@ -185,11 +184,15 @@ void KItemListContainer::wheelEvent(QWheelEvent* event)
     KItemListSmoothScroller* smoothScroller = scrollHorizontally ?
                                               m_horizontalSmoothScroller : m_verticalSmoothScroller;
 
-    const int numDegrees = event->delta() / 8;
-    const int numSteps = numDegrees / 15;
-
     const QScrollBar* scrollBar = smoothScroller->scrollBar();
-    smoothScroller->scrollTo(scrollBar->value() - numSteps * scrollBar->pageStep() / 4);
+    if (!event->pixelDelta().isNull()) {
+        const int numPixels =  event->pixelDelta().y();
+        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);
+    }
 
     event->accept();
 }
@@ -413,4 +416,3 @@ void KItemListContainer::updateScrollOffsetScrollBarPolicy()
     }
 }
 
-#include "kitemlistcontainer.moc"