From e7b078a7fdf27af7927b5edea53fde0cf63ca8e5 Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Thu, 2 Dec 2021 23:59:58 +0100 Subject: [PATCH] profile: remove unused animation functions A few animation function are not necessary anymore. Remove them. Signed-off-by: Berthold Stoeger --- profile-widget/animationfunctions.cpp | 33 +-------------------------- profile-widget/animationfunctions.h | 8 +------ 2 files changed, 2 insertions(+), 39 deletions(-) diff --git a/profile-widget/animationfunctions.cpp b/profile-widget/animationfunctions.cpp index a003e28ac..817592981 100644 --- a/profile-widget/animationfunctions.cpp +++ b/profile-widget/animationfunctions.cpp @@ -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()); - } } diff --git a/profile-widget/animationfunctions.h b/profile-widget/animationfunctions.h index f8af01859..5137b7320 100644 --- a/profile-widget/animationfunctions.h +++ b/profile-widget/animationfunctions.h @@ -2,18 +2,12 @@ #ifndef ANIMATIONFUNCTIONS_H #define ANIMATIONFUNCTIONS_H -#include -#include - 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