From 303740c68af83f45be1bdea56a250397a83efa6a Mon Sep 17 00:00:00 2001 From: Eduard Manta Date: Tue, 22 Dec 2020 22:16:52 +0000 Subject: [PATCH] Fix vertical scroll with horizontal component not being recognized properly BUG: 430532 a scroll that includes an horizontal component != 0 might still be a vertical scroll --- src/kitemviews/kitemlistcontainer.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/kitemviews/kitemlistcontainer.cpp b/src/kitemviews/kitemlistcontainer.cpp index 77847bcc79..f253cda539 100644 --- a/src/kitemviews/kitemlistcontainer.cpp +++ b/src/kitemviews/kitemlistcontainer.cpp @@ -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;