]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/kitemviews/private/kitemlistsmoothscroller.cpp
Port Dolphin away from KApplication, KCmdLineArgs and K4AboutData
[dolphin.git] / src / kitemviews / private / kitemlistsmoothscroller.cpp
index 24eea0cefb8bbf75527920c947fd0e218eb0a502..d5efc2c61d1f1c49318d10e3fdc8c13d606a4346 100644 (file)
 
 #include "kitemlistsmoothscroller.h"
 
-#include <KGlobalSettings>
 #include <QEvent>
 #include <QPropertyAnimation>
 #include <QScrollBar>
 #include <QWheelEvent>
-
-#include <KDebug>
+#include <QStyle>
+#include <QDebug>
 
 KItemListSmoothScroller::KItemListSmoothScroller(QScrollBar* scrollBar,
                                                  QObject* parent) :
@@ -36,7 +35,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);