From b94b172f5163fe5daab50dc197171d3662ee7c0d Mon Sep 17 00:00:00 2001 From: Nathan Misner Date: Fri, 5 Jul 2024 15:49:47 +0000 Subject: Add support for Plasma's global smooth scrolling setting KItemListSmoothScroller now checks whether smooth scrolling is enabled globally and listens for any changes to the setting via DBus. --- src/kitemviews/private/kitemlistsmoothscroller.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/kitemviews/private/kitemlistsmoothscroller.h') diff --git a/src/kitemviews/private/kitemlistsmoothscroller.h b/src/kitemviews/private/kitemlistsmoothscroller.h index d1cfcf9d9..32effa3d6 100644 --- a/src/kitemviews/private/kitemlistsmoothscroller.h +++ b/src/kitemviews/private/kitemlistsmoothscroller.h @@ -79,6 +79,13 @@ protected: private Q_SLOTS: void slotAnimationStateChanged(QAbstractAnimation::State newState, QAbstractAnimation::State oldState); + /** + * Calculates the duration of the smooth scrolling animation. + * If \p isSmoothScrollingEnabled is true, the duration will be calculated + * using the widget animation duration from the current style. Otherwise, + * the animation will be instantaneous. + */ + void updateAnimationDuration(bool isSmoothScrollingEnabled); private: bool m_scrollBarPressed; -- cgit v1.3.1