diff options
Diffstat (limited to 'src/kitemviews/kitemlistviewanimation.cpp')
| -rw-r--r-- | src/kitemviews/kitemlistviewanimation.cpp | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/kitemviews/kitemlistviewanimation.cpp b/src/kitemviews/kitemlistviewanimation.cpp index 9b122ee8c..9184b7144 100644 --- a/src/kitemviews/kitemlistviewanimation.cpp +++ b/src/kitemviews/kitemlistviewanimation.cpp @@ -22,16 +22,21 @@ #include "kitemlistview.h" #include <KDebug> +#include <KGlobalSettings> #include <QGraphicsWidget> #include <QPropertyAnimation> KItemListViewAnimation::KItemListViewAnimation(QObject* parent) : QObject(parent), + m_animationDuration(200), m_scrollOrientation(Qt::Vertical), m_scrollOffset(0), m_animation() { + if (KGlobalSettings::graphicEffectsLevel() == KGlobalSettings::NoEffects) { + m_animationDuration = 1; + } } KItemListViewAnimation::~KItemListViewAnimation() @@ -117,7 +122,6 @@ void KItemListViewAnimation::start(QGraphicsWidget* widget, AnimationType type, { stop(widget, type); - const int duration = 200; QPropertyAnimation* propertyAnim = 0; switch (type) { @@ -128,7 +132,7 @@ void KItemListViewAnimation::start(QGraphicsWidget* widget, AnimationType type, } propertyAnim = new QPropertyAnimation(widget, "pos"); - propertyAnim->setDuration(duration); + propertyAnim->setDuration(m_animationDuration); propertyAnim->setEndValue(newPos); break; } @@ -136,7 +140,7 @@ void KItemListViewAnimation::start(QGraphicsWidget* widget, AnimationType type, case CreateAnimation: { propertyAnim = new QPropertyAnimation(widget, "opacity"); propertyAnim->setEasingCurve(QEasingCurve::InQuart); - propertyAnim->setDuration(duration); + propertyAnim->setDuration(m_animationDuration); propertyAnim->setStartValue(0.0); propertyAnim->setEndValue(1.0); break; @@ -145,7 +149,7 @@ void KItemListViewAnimation::start(QGraphicsWidget* widget, AnimationType type, case DeleteAnimation: { propertyAnim = new QPropertyAnimation(widget, "opacity"); propertyAnim->setEasingCurve(QEasingCurve::OutQuart); - propertyAnim->setDuration(duration); + propertyAnim->setDuration(m_animationDuration); propertyAnim->setStartValue(1.0); propertyAnim->setEndValue(0.0); break; @@ -158,7 +162,7 @@ void KItemListViewAnimation::start(QGraphicsWidget* widget, AnimationType type, } propertyAnim = new QPropertyAnimation(widget, "size"); - propertyAnim->setDuration(duration); + propertyAnim->setDuration(m_animationDuration); propertyAnim->setEndValue(newSize); break; } |
