]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Fix vertical scroll with horizontal component not being recognized properly
authorEduard Manta <mantapeppe@gmail.com>
Tue, 22 Dec 2020 22:16:52 +0000 (22:16 +0000)
committerEduard Manta <mantapeppe@gmail.com>
Wed, 23 Dec 2020 16:17:19 +0000 (17:17 +0100)
BUG: 430532

a scroll that includes an horizontal component != 0 might still be a vertical scroll

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;