┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/kitemviews/kitemlistcontainer.cpp
diff options
context:
space:
mode:
authorKetal Wang <[email protected]>2026-05-29 18:14:59 +0800
committerketal yuni <[email protected]>2026-06-10 11:33:48 +0000
commit6eed05fd769b01c37530b8b62cdcd65933ea8d14 (patch)
tree40f3eb5a00704544bcfe652710644294ae6788a0 /src/kitemviews/kitemlistcontainer.cpp
parentb36ac352bf04b10db66864f107cbc2cdd4d8a217 (diff)
kitemviews: handle macOS pixel wheel scrolling immediately
Diffstat (limited to 'src/kitemviews/kitemlistcontainer.cpp')
-rw-r--r--src/kitemviews/kitemlistcontainer.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/kitemviews/kitemlistcontainer.cpp b/src/kitemviews/kitemlistcontainer.cpp
index 3ec56e5f1..b221ca5ff 100644
--- a/src/kitemviews/kitemlistcontainer.cpp
+++ b/src/kitemviews/kitemlistcontainer.cpp
@@ -187,7 +187,12 @@ void KItemListContainer::wheelEvent(QWheelEvent *event)
return;
}
- const bool scrollHorizontally = (qAbs(event->angleDelta().y()) < qAbs(event->angleDelta().x())) || (!verticalScrollBar()->isVisible());
+#ifdef Q_OS_MACOS
+ const QPoint scrollDelta = event->hasPixelDelta() ? event->pixelDelta() : event->angleDelta();
+#else
+ const QPoint scrollDelta = event->angleDelta();
+#endif
+ const bool scrollHorizontally = (qAbs(scrollDelta.y()) < qAbs(scrollDelta.x())) || (!verticalScrollBar()->isVisible());
KItemListSmoothScroller *smoothScroller = scrollHorizontally ? m_horizontalSmoothScroller : m_verticalSmoothScroller;
smoothScroller->handleWheelEvent(event);