diff options
| author | arnav dhamija <[email protected]> | 2016-09-25 23:13:22 +0530 |
|---|---|---|
| committer | arnav dhamija <[email protected]> | 2016-09-25 23:13:22 +0530 |
| commit | 67099640b90588af1c72c340756253400da3e95b (patch) | |
| tree | 16fe472cc13677496793c2a4967097e978379ef4 /src/kitemviews/kitemlistcontainer.cpp | |
| parent | ccd0a74eed22c35b5eb72e6f46e747f621169732 (diff) | |
| parent | 1710304e9ba926d2aec4226d00974b826f9bcbc0 (diff) | |
Merge branch 'master' of git.kde.org:dolphin
Diffstat (limited to 'src/kitemviews/kitemlistcontainer.cpp')
| -rw-r--r-- | src/kitemviews/kitemlistcontainer.cpp | 22 |
1 files changed, 1 insertions, 21 deletions
diff --git a/src/kitemviews/kitemlistcontainer.cpp b/src/kitemviews/kitemlistcontainer.cpp index 69a0a5f27..6974ebb48 100644 --- a/src/kitemviews/kitemlistcontainer.cpp +++ b/src/kitemviews/kitemlistcontainer.cpp @@ -185,27 +185,7 @@ void KItemListContainer::wheelEvent(QWheelEvent* event) KItemListSmoothScroller* smoothScroller = scrollHorizontally ? m_horizontalSmoothScroller : m_verticalSmoothScroller; - const QScrollBar* scrollBar = smoothScroller->scrollBar(); - if (!event->pixelDelta().isNull()) { - const int numPixels = event->pixelDelta().y(); - 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 = qApp->wheelScrollLines() * numDegrees / 15; - 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() / 12); - } - } - - event->accept(); + smoothScroller->handleWheelEvent(event); } void KItemListContainer::slotScrollOrientationChanged(Qt::Orientation current, Qt::Orientation previous) |
