profile: remove unused animation functions

A few animation function are not necessary anymore.
Remove them.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2021-12-02 23:59:58 +01:00 committed by Dirk Hohndel
parent 5c5c0c4880
commit e7b078a7fd
2 changed files with 2 additions and 39 deletions

View file

@ -29,33 +29,7 @@ namespace Animations {
}
}
void animDelete(QObject *obj, int speed)
{
if (speed != 0) {
QPropertyAnimation *animation = new QPropertyAnimation(obj, "opacity");
obj->connect(animation, &QPropertyAnimation::finished, &QObject::deleteLater);
animation->setStartValue(1);
animation->setEndValue(0);
animation->start(QAbstractAnimation::DeleteWhenStopped);
} else {
delete obj;
}
}
void moveTo(QObject *obj, int speed, qreal x, qreal y)
{
if (speed != 0) {
QPropertyAnimation *animation = new QPropertyAnimation(obj, "pos");
animation->setDuration(prefs.animation_speed);
animation->setStartValue(obj->property("pos").toPointF());
animation->setEndValue(QPointF(x, y));
animation->start(QAbstractAnimation::DeleteWhenStopped);
} else {
obj->setProperty("pos", QPointF(x, y));
}
}
void scaleTo(QObject *obj, int speed, qreal scale)
void scaleTo(QObject *obj, int speed, double scale)
{
if (speed != 0) {
QPropertyAnimation *animation = new QPropertyAnimation(obj, "scale");
@ -68,9 +42,4 @@ namespace Animations {
obj->setProperty("scale", QVariant::fromValue(scale));
}
}
void moveTo(QObject *obj, int speed, const QPointF &pos)
{
moveTo(obj, speed, pos.x(), pos.y());
}
}

View file

@ -2,18 +2,12 @@
#ifndef ANIMATIONFUNCTIONS_H
#define ANIMATIONFUNCTIONS_H
#include <QtGlobal>
#include <QPointF>
class QObject;
namespace Animations {
void hide(QObject *obj, int speed);
void show(QObject *obj, int speed);
void moveTo(QObject *obj, int speed, qreal x, qreal y);
void moveTo(QObject *obj, int speed, const QPointF &pos);
void animDelete(QObject *obj, int speed);
void scaleTo(QObject *obj, int speed, qreal scale);
void scaleTo(QObject *obj, int speed, double scale);
}
#endif // ANIMATIONFUNCTIONS_H