summaryrefslogtreecommitdiffstats
path: root/qt-ui/profile/animationfunctions.cpp
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tomaz.canabrava@intel.com>2014-07-21 19:10:31 -0300
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-07-23 07:50:03 -0700
commit65eefe7b599575bf401c0adc9c61e42bc56fc4c9 (patch)
treee01593eb7f4a089c466c35cd166971f7bae9f962 /qt-ui/profile/animationfunctions.cpp
parent82bcb1767c8ca1fdecc2bc40eb3a47fc1bd2a147 (diff)
downloadsubsurface-65eefe7b599575bf401c0adc9c61e42bc56fc4c9.tar.gz
Animation speed is a value, not a boolean
This breaks compatibility with old preferences, but it's a single key and not that very important so I don't think it's a bigger issue I've renamed prefs.animation to prefs.animation_speed to denote that it's a value, and not a state. Also, fixed the places that were treating it as a state (on/off) to treat it like a correct value. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/profile/animationfunctions.cpp')
-rw-r--r--qt-ui/profile/animationfunctions.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/qt-ui/profile/animationfunctions.cpp b/qt-ui/profile/animationfunctions.cpp
index 9f3aa8366..dc46d7f82 100644
--- a/qt-ui/profile/animationfunctions.cpp
+++ b/qt-ui/profile/animationfunctions.cpp
@@ -8,7 +8,7 @@ namespace Animations {
void hide(QObject *obj)
{
- if (prefs.animation != 0) {
+ if (prefs.animation_speed != 0) {
QPropertyAnimation *animation = new QPropertyAnimation(obj, "opacity");
animation->setStartValue(1);
animation->setEndValue(0);
@@ -20,7 +20,7 @@ namespace Animations {
void animDelete(QObject *obj)
{
- if (prefs.animation != 0) {
+ if (prefs.animation_speed != 0) {
QPropertyAnimation *animation = new QPropertyAnimation(obj, "opacity");
obj->connect(animation, SIGNAL(finished()), SLOT(deleteLater()));
animation->setStartValue(1);
@@ -33,9 +33,9 @@ namespace Animations {
void moveTo(QObject *obj, qreal x, qreal y)
{
- if (prefs.animation != 0) {
+ if (prefs.animation_speed != 0) {
QPropertyAnimation *animation = new QPropertyAnimation(obj, "pos");
- animation->setDuration(prefs.animation);
+ animation->setDuration(prefs.animation_speed);
animation->setStartValue(obj->property("pos").toPointF());
animation->setEndValue(QPointF(x, y));
animation->start(QAbstractAnimation::DeleteWhenStopped);
@@ -46,9 +46,9 @@ namespace Animations {
void scaleTo(QObject *obj, qreal scale)
{
- if (prefs.animation != 0) {
+ if (prefs.animation_speed != 0) {
QPropertyAnimation *animation = new QPropertyAnimation(obj, "scale");
- animation->setDuration(prefs.animation);
+ animation->setDuration(prefs.animation_speed);
animation->setStartValue(obj->property("scale").toReal());
animation->setEndValue(QVariant::fromValue(scale));
animation->setEasingCurve(QEasingCurve::InCubic);