mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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:
parent
5c5c0c4880
commit
e7b078a7fd
2 changed files with 2 additions and 39 deletions
|
@ -29,33 +29,7 @@ namespace Animations {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void animDelete(QObject *obj, int speed)
|
void scaleTo(QObject *obj, int speed, double scale)
|
||||||
{
|
|
||||||
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)
|
|
||||||
{
|
{
|
||||||
if (speed != 0) {
|
if (speed != 0) {
|
||||||
QPropertyAnimation *animation = new QPropertyAnimation(obj, "scale");
|
QPropertyAnimation *animation = new QPropertyAnimation(obj, "scale");
|
||||||
|
@ -68,9 +42,4 @@ namespace Animations {
|
||||||
obj->setProperty("scale", QVariant::fromValue(scale));
|
obj->setProperty("scale", QVariant::fromValue(scale));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void moveTo(QObject *obj, int speed, const QPointF &pos)
|
|
||||||
{
|
|
||||||
moveTo(obj, speed, pos.x(), pos.y());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,18 +2,12 @@
|
||||||
#ifndef ANIMATIONFUNCTIONS_H
|
#ifndef ANIMATIONFUNCTIONS_H
|
||||||
#define ANIMATIONFUNCTIONS_H
|
#define ANIMATIONFUNCTIONS_H
|
||||||
|
|
||||||
#include <QtGlobal>
|
|
||||||
#include <QPointF>
|
|
||||||
|
|
||||||
class QObject;
|
class QObject;
|
||||||
|
|
||||||
namespace Animations {
|
namespace Animations {
|
||||||
void hide(QObject *obj, int speed);
|
void hide(QObject *obj, int speed);
|
||||||
void show(QObject *obj, int speed);
|
void show(QObject *obj, int speed);
|
||||||
void moveTo(QObject *obj, int speed, qreal x, qreal y);
|
void scaleTo(QObject *obj, int speed, double scale);
|
||||||
void moveTo(QObject *obj, int speed, const QPointF &pos);
|
|
||||||
void animDelete(QObject *obj, int speed);
|
|
||||||
void scaleTo(QObject *obj, int speed, qreal scale);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // ANIMATIONFUNCTIONS_H
|
#endif // ANIMATIONFUNCTIONS_H
|
||||||
|
|
Loading…
Add table
Reference in a new issue