]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/kitemviews/kitemlistcontainer.cpp
Fix crash calling openDirectories() in various cases
[dolphin.git] / src / kitemviews / kitemlistcontainer.cpp
index 77847bcc7967576119898b7432d6179b6c9ab9be..f253cda539dc03d2957516a07bedbbd6822c0323 100644 (file)
@@ -172,8 +172,8 @@ void KItemListContainer::wheelEvent(QWheelEvent* event)
         return;
     }
 
-    const bool scrollHorizontally = (event->angleDelta().x() != 0) ||
-                                    (event->angleDelta().y() != 0 && !verticalScrollBar()->isVisible());
+    const bool scrollHorizontally = (qAbs(event->angleDelta().y()) < qAbs(event->angleDelta().x())) ||
+                                    (!verticalScrollBar()->isVisible());
     KItemListSmoothScroller* smoothScroller = scrollHorizontally ?
                                               m_horizontalSmoothScroller : m_verticalSmoothScroller;