]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/kitemviews/private/kitemlistsmoothscroller.cpp
Merge branch 'master' into frameworks
[dolphin.git] / src / kitemviews / private / kitemlistsmoothscroller.cpp
index 994d86174fef9e7d091b037365ae7ca2c3acbee9..e70f478904dbb81619e67ac07287be48ca9f95bf 100644 (file)
 
 #include "kitemlistsmoothscroller.h"
 
-#include <KGlobalSettings>
 #include <QEvent>
 #include <QPropertyAnimation>
 #include <QScrollBar>
 #include <QWheelEvent>
-
-#include <KDebug>
+#include <QStyle>
 
 KItemListSmoothScroller::KItemListSmoothScroller(QScrollBar* scrollBar,
                                                  QObject* parent) :
@@ -36,7 +34,7 @@ KItemListSmoothScroller::KItemListSmoothScroller(QScrollBar* scrollBar,
     m_animation(0)
 {
     m_animation = new QPropertyAnimation(this);
-    const int duration = (KGlobalSettings::graphicEffectsLevel() == KGlobalSettings::NoEffects) ? 1 : 100;
+    const int duration = m_scrollBar->style()->styleHint(QStyle::SH_Widget_Animate, nullptr, m_scrollBar) ? 100 : 1;
     m_animation->setDuration(duration);
     connect(m_animation, &QPropertyAnimation::stateChanged,
             this, &KItemListSmoothScroller::slotAnimationStateChanged);
@@ -209,4 +207,3 @@ void KItemListSmoothScroller::handleWheelEvent(QWheelEvent* event)
     event->accept();
 }
 
-#include "kitemlistsmoothscroller.moc"