diff --git a/src/chatlog/content/spinner.cpp b/src/chatlog/content/spinner.cpp index a07d933e2..7d912fdfb 100644 --- a/src/chatlog/content/spinner.cpp +++ b/src/chatlog/content/spinner.cpp @@ -19,10 +19,11 @@ #include #include -Spinner::Spinner(QSizeF Size) +Spinner::Spinner(const QString &img, QSizeF Size, qreal speed) : size(Size) + , rotSpeed(speed) { - pmap.load(":/ui/chatArea/spinner.png"); + pmap.load(img); timer.setInterval(33); // 30Hz timer.setSingleShot(false); @@ -77,6 +78,6 @@ qreal Spinner::getAscent() const void Spinner::timeout() { - rot += 8; + rot += rotSpeed; update(); } diff --git a/src/chatlog/content/spinner.h b/src/chatlog/content/spinner.h index d73079f71..894a10761 100644 --- a/src/chatlog/content/spinner.h +++ b/src/chatlog/content/spinner.h @@ -26,7 +26,7 @@ class Spinner : public QObject, public ChatLineContent { Q_OBJECT public: - Spinner(QSizeF size); + Spinner(const QString& img, QSizeF size, qreal speed); virtual QRectF boundingRect() const override; virtual QRectF boundingSceneRect() const override; @@ -41,7 +41,8 @@ private slots: private: QSizeF size; QPixmap pmap; - qreal rot; + qreal rot = 0.0; + qreal rotSpeed; QTimer timer; };