summaryrefslogtreecommitdiffstats
path: root/qt-ui/profile/animationfunctions.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'qt-ui/profile/animationfunctions.cpp')
-rw-r--r--qt-ui/profile/animationfunctions.cpp42
1 files changed, 27 insertions, 15 deletions
diff --git a/qt-ui/profile/animationfunctions.cpp b/qt-ui/profile/animationfunctions.cpp
index c680e11a5..9f3aa8366 100644
--- a/qt-ui/profile/animationfunctions.cpp
+++ b/qt-ui/profile/animationfunctions.cpp
@@ -8,19 +8,27 @@ namespace Animations {
void hide(QObject *obj)
{
- QPropertyAnimation *animation = new QPropertyAnimation(obj, "opacity");
- animation->setStartValue(1);
- animation->setEndValue(0);
- animation->start(QAbstractAnimation::DeleteWhenStopped);
+ if (prefs.animation != 0) {
+ QPropertyAnimation *animation = new QPropertyAnimation(obj, "opacity");
+ animation->setStartValue(1);
+ animation->setEndValue(0);
+ animation->start(QAbstractAnimation::DeleteWhenStopped);
+ } else {
+ obj->setProperty("opacity", 0);
+ }
}
void animDelete(QObject *obj)
{
- QPropertyAnimation *animation = new QPropertyAnimation(obj, "opacity");
- obj->connect(animation, SIGNAL(finished()), SLOT(deleteLater()));
- animation->setStartValue(1);
- animation->setEndValue(0);
- animation->start(QAbstractAnimation::DeleteWhenStopped);
+ if (prefs.animation != 0) {
+ QPropertyAnimation *animation = new QPropertyAnimation(obj, "opacity");
+ obj->connect(animation, SIGNAL(finished()), SLOT(deleteLater()));
+ animation->setStartValue(1);
+ animation->setEndValue(0);
+ animation->start(QAbstractAnimation::DeleteWhenStopped);
+ } else {
+ obj->setProperty("opacity", 0);
+ }
}
void moveTo(QObject *obj, qreal x, qreal y)
@@ -38,12 +46,16 @@ namespace Animations {
void scaleTo(QObject *obj, qreal scale)
{
- QPropertyAnimation *animation = new QPropertyAnimation(obj, "scale");
- animation->setDuration(prefs.animation);
- animation->setStartValue(obj->property("scale").toReal());
- animation->setEndValue(QVariant::fromValue(scale));
- animation->setEasingCurve(QEasingCurve::InCubic);
- animation->start(QAbstractAnimation::DeleteWhenStopped);
+ if (prefs.animation != 0) {
+ QPropertyAnimation *animation = new QPropertyAnimation(obj, "scale");
+ animation->setDuration(prefs.animation);
+ animation->setStartValue(obj->property("scale").toReal());
+ animation->setEndValue(QVariant::fromValue(scale));
+ animation->setEasingCurve(QEasingCurve::InCubic);
+ animation->start(QAbstractAnimation::DeleteWhenStopped);
+ } else {
+ obj->setProperty("scale", QVariant::fromValue(scale));
+ }
}
void moveTo(QObject *obj, const QPointF &pos)