]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/kitemviews/private/kitemlistsmoothscroller.cpp
Merge remote-tracking branch 'origin/release/21.08'
[dolphin.git] / src / kitemviews / private / kitemlistsmoothscroller.cpp
index 6b475b5f03e425a80640021ed30b871f8907f4e8..f77d3df58d73e2a327ed17a93c4b1e48f051a797 100644 (file)
@@ -21,13 +21,8 @@ KItemListSmoothScroller::KItemListSmoothScroller(QScrollBar* scrollBar,
     m_animation(nullptr)
 {
     m_animation = new QPropertyAnimation(this);
-#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)
     const int animationDuration = m_scrollBar->style()->styleHint(QStyle::SH_Widget_Animation_Duration, nullptr, m_scrollBar);
     const bool animationEnabled = (animationDuration > 0);
- #else
-    const int animationDuration = 100;
-    const bool animationEnabled = m_scrollBar->style()->styleHint(QStyle::SH_Widget_Animate, nullptr, m_scrollBar);
-#endif
     m_animation->setDuration(animationEnabled ? animationDuration : 1);
     connect(m_animation, &QPropertyAnimation::stateChanged,
             this, &KItemListSmoothScroller::slotAnimationStateChanged);
@@ -180,6 +175,9 @@ void KItemListSmoothScroller::slotAnimationStateChanged(QAbstractAnimation::Stat
     if (newState == QAbstractAnimation::Stopped && m_smoothScrolling && !m_scrollBarPressed) {
         m_smoothScrolling = false;
     }
+    if (newState == QAbstractAnimation::Stopped) {
+        Q_EMIT scrollingStopped();
+    }
 }
 
 void KItemListSmoothScroller::handleWheelEvent(QWheelEvent* event)