// // Created by Louis on 25-4-1. // #ifndef QANTPRIMARYBUTTON_H #define QANTPRIMARYBUTTON_H #include "QAntAbstractButton.h" #include #include class QAntPrimaryButton : public QAntAbstractButton{ Q_OBJECT public: explicit QAntPrimaryButton(QWidget* parent = nullptr); ~QAntPrimaryButton(); QColor normalColor() const; void setNormalColor(const QColor& color); QColor hoverColor() const; void setHoverColor(const QColor& color); QColor pressedColor() const; void setPressedColor(const QColor& color); QColor disabledColor() const; void setDisabledColor(const QColor& color); QColor textColor() const; void setTextColor(const QColor& color); QColor textDisabledColor() const; void setTextDisabledColor(const QColor& color); qreal xRadius() const; void setXRadius(const qreal& x); qreal yRadius() const; void setYRadius(const qreal& y); qreal borderWidth() const; void setBorderWidth(qreal& w); QSize sizeHint(); protected: void paintNormalState(QPainter &painter) override; void paintHoverState(QPainter &painter) override; void paintPressedState(QPainter &painter) override; void paintDisabledState(QPainter &painter) override; void paintLoadingState(QPainter &painter) override; void paintText(QPainter &painter, const QRect &textRect) override; QColor rippleColor() const override; private: QColor m_normalColor; QColor m_pressedColor; QColor m_hoverColor; QColor m_disabledColor; QColor m_textColor; QColor m_textDisabledColor; qreal m_xRadius; qreal m_yRadius; qreal m_borderWidth; }; #endif //QANTPRIMARYBUTTON_H