Respect the graphicseffect level in the system settings. This will disable
all item-animations if the graphicseffect level is "NoEffect".
The smooth scrolling won't be disabled in this case, but the duration has been
made smaller so that it is not recognized as an animation.
BUG: 289238
FIXED-IN: 4.8.0
m_animation(0)
{
m_animation = new QPropertyAnimation(this);
m_animation(0)
{
m_animation = new QPropertyAnimation(this);
- m_animation->setDuration(300);
+ m_animation->setDuration(200);
connect(m_animation, SIGNAL(stateChanged(QAbstractAnimation::State,QAbstractAnimation::State)),
this, SLOT(slotAnimationStateChanged(QAbstractAnimation::State,QAbstractAnimation::State)));
connect(m_animation, SIGNAL(stateChanged(QAbstractAnimation::State,QAbstractAnimation::State)),
this, SLOT(slotAnimationStateChanged(QAbstractAnimation::State,QAbstractAnimation::State)));
#include "kitemlistview.h"
#include <KDebug>
#include "kitemlistview.h"
#include <KDebug>
+#include <KGlobalSettings>
#include <QGraphicsWidget>
#include <QPropertyAnimation>
KItemListViewAnimation::KItemListViewAnimation(QObject* parent) :
QObject(parent),
#include <QGraphicsWidget>
#include <QPropertyAnimation>
KItemListViewAnimation::KItemListViewAnimation(QObject* parent) :
QObject(parent),
+ m_animationDuration(200),
m_scrollOrientation(Qt::Vertical),
m_scrollOffset(0),
m_animation()
{
m_scrollOrientation(Qt::Vertical),
m_scrollOffset(0),
m_animation()
{
+ if (KGlobalSettings::graphicEffectsLevel() == KGlobalSettings::NoEffects) {
+ m_animationDuration = 1;
+ }
}
KItemListViewAnimation::~KItemListViewAnimation()
}
KItemListViewAnimation::~KItemListViewAnimation()
- const int duration = 200;
QPropertyAnimation* propertyAnim = 0;
switch (type) {
QPropertyAnimation* propertyAnim = 0;
switch (type) {
}
propertyAnim = new QPropertyAnimation(widget, "pos");
}
propertyAnim = new QPropertyAnimation(widget, "pos");
- propertyAnim->setDuration(duration);
+ propertyAnim->setDuration(m_animationDuration);
propertyAnim->setEndValue(newPos);
break;
}
propertyAnim->setEndValue(newPos);
break;
}
case CreateAnimation: {
propertyAnim = new QPropertyAnimation(widget, "opacity");
propertyAnim->setEasingCurve(QEasingCurve::InQuart);
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;
propertyAnim->setStartValue(0.0);
propertyAnim->setEndValue(1.0);
break;
case DeleteAnimation: {
propertyAnim = new QPropertyAnimation(widget, "opacity");
propertyAnim->setEasingCurve(QEasingCurve::OutQuart);
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;
propertyAnim->setStartValue(1.0);
propertyAnim->setEndValue(0.0);
break;
}
propertyAnim = new QPropertyAnimation(widget, "size");
}
propertyAnim = new QPropertyAnimation(widget, "size");
- propertyAnim->setDuration(duration);
+ propertyAnim->setDuration(m_animationDuration);
propertyAnim->setEndValue(newSize);
break;
}
propertyAnim->setEndValue(newSize);
break;
}
private:
enum { AnimationTypeCount = 4 };
private:
enum { AnimationTypeCount = 4 };
+ int m_animationDuration;
Qt::Orientation m_scrollOrientation;
qreal m_scrollOffset;
QHash<QGraphicsWidget*, QPropertyAnimation*> m_animation[AnimationTypeCount];
Qt::Orientation m_scrollOrientation;
qreal m_scrollOffset;
QHash<QGraphicsWidget*, QPropertyAnimation*> m_animation[AnimationTypeCount];