diff options
Diffstat (limited to 'src/ui/Ripple.h')
-rw-r--r-- | src/ui/Ripple.h | 98 |
1 files changed, 49 insertions, 49 deletions
diff --git a/src/ui/Ripple.h b/src/ui/Ripple.h index 2ad42b9e..df09caba 100644 --- a/src/ui/Ripple.h +++ b/src/ui/Ripple.h @@ -14,136 +14,136 @@ class RippleOverlay; class Ripple : public QParallelAnimationGroup { - Q_OBJECT + Q_OBJECT - Q_PROPERTY(qreal radius WRITE setRadius READ radius) - Q_PROPERTY(qreal opacity WRITE setOpacity READ opacity) + Q_PROPERTY(qreal radius WRITE setRadius READ radius) + Q_PROPERTY(qreal opacity WRITE setOpacity READ opacity) public: - explicit Ripple(const QPoint ¢er, QObject *parent = nullptr); - Ripple(const QPoint ¢er, RippleOverlay *overlay, QObject *parent = nullptr); + explicit Ripple(const QPoint ¢er, QObject *parent = nullptr); + Ripple(const QPoint ¢er, RippleOverlay *overlay, QObject *parent = nullptr); - inline void setOverlay(RippleOverlay *overlay); + inline void setOverlay(RippleOverlay *overlay); - void setRadius(qreal radius); - void setOpacity(qreal opacity); - void setColor(const QColor &color); - void setBrush(const QBrush &brush); + void setRadius(qreal radius); + void setOpacity(qreal opacity); + void setColor(const QColor &color); + void setBrush(const QBrush &brush); - inline qreal radius() const; - inline qreal opacity() const; - inline QColor color() const; - inline QBrush brush() const; - inline QPoint center() const; + inline qreal radius() const; + inline qreal opacity() const; + inline QColor color() const; + inline QBrush brush() const; + inline QPoint center() const; - inline QPropertyAnimation *radiusAnimation() const; - inline QPropertyAnimation *opacityAnimation() const; + inline QPropertyAnimation *radiusAnimation() const; + inline QPropertyAnimation *opacityAnimation() const; - inline void setOpacityStartValue(qreal value); - inline void setOpacityEndValue(qreal value); - inline void setRadiusStartValue(qreal value); - inline void setRadiusEndValue(qreal value); - inline void setDuration(int msecs); + inline void setOpacityStartValue(qreal value); + inline void setOpacityEndValue(qreal value); + inline void setRadiusStartValue(qreal value); + inline void setRadiusEndValue(qreal value); + inline void setDuration(int msecs); protected slots: - void destroy(); + void destroy(); private: - Q_DISABLE_COPY(Ripple) + Q_DISABLE_COPY(Ripple) - QPropertyAnimation *animate(const QByteArray &property, - const QEasingCurve &easing = QEasingCurve::OutQuad, - int duration = 800); + QPropertyAnimation *animate(const QByteArray &property, + const QEasingCurve &easing = QEasingCurve::OutQuad, + int duration = 800); - void init(); + void init(); - RippleOverlay *overlay_; + RippleOverlay *overlay_; - QPropertyAnimation *const radius_anim_; - QPropertyAnimation *const opacity_anim_; + QPropertyAnimation *const radius_anim_; + QPropertyAnimation *const opacity_anim_; - qreal radius_; - qreal opacity_; + qreal radius_; + qreal opacity_; - QPoint center_; - QBrush brush_; + QPoint center_; + QBrush brush_; }; inline void Ripple::setOverlay(RippleOverlay *overlay) { - overlay_ = overlay; + overlay_ = overlay; } inline qreal Ripple::radius() const { - return radius_; + return radius_; } inline qreal Ripple::opacity() const { - return opacity_; + return opacity_; } inline QColor Ripple::color() const { - return brush_.color(); + return brush_.color(); } inline QBrush Ripple::brush() const { - return brush_; + return brush_; } inline QPoint Ripple::center() const { - return center_; + return center_; } inline QPropertyAnimation * Ripple::radiusAnimation() const { - return radius_anim_; + return radius_anim_; } inline QPropertyAnimation * Ripple::opacityAnimation() const { - return opacity_anim_; + return opacity_anim_; } inline void Ripple::setOpacityStartValue(qreal value) { - opacity_anim_->setStartValue(value); + opacity_anim_->setStartValue(value); } inline void Ripple::setOpacityEndValue(qreal value) { - opacity_anim_->setEndValue(value); + opacity_anim_->setEndValue(value); } inline void Ripple::setRadiusStartValue(qreal value) { - radius_anim_->setStartValue(value); + radius_anim_->setStartValue(value); } inline void Ripple::setRadiusEndValue(qreal value) { - radius_anim_->setEndValue(value); + radius_anim_->setEndValue(value); } inline void Ripple::setDuration(int msecs) { - radius_anim_->setDuration(msecs); - opacity_anim_->setDuration(msecs); + radius_anim_->setDuration(msecs); + opacity_anim_->setDuration(msecs); } |