summary refs log tree commit diff
path: root/src/ui/FlatButton.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui/FlatButton.h')
-rw-r--r--src/ui/FlatButton.h33
1 files changed, 24 insertions, 9 deletions
diff --git a/src/ui/FlatButton.h b/src/ui/FlatButton.h

index 3f2c3f05..307e5520 100644 --- a/src/ui/FlatButton.h +++ b/src/ui/FlatButton.h
@@ -16,9 +16,10 @@ class FlatButtonStateMachine : public QStateMachine { Q_OBJECT - Q_PROPERTY(qreal overlayOpacity WRITE setOverlayOpacity READ overlayOpacity) Q_PROPERTY( - qreal checkedOverlayProgress WRITE setCheckedOverlayProgress READ checkedOverlayProgress) + qreal overlayOpacity WRITE setOverlayOpacity READ overlayOpacity NOTIFY overlayOpacityChanged) + Q_PROPERTY(qreal checkedOverlayProgress WRITE setCheckedOverlayProgress READ + checkedOverlayProgress NOTIFY checkedOverlayProgressChanged) public: explicit FlatButtonStateMachine(FlatButton *parent); @@ -38,6 +39,9 @@ signals: void buttonChecked(); void buttonUnchecked(); + void overlayOpacityChanged(); + void checkedOverlayProgressChanged(); + protected: bool eventFilter(QObject *watched, QEvent *event) override; @@ -81,14 +85,17 @@ class FlatButton : public QPushButton { Q_OBJECT - Q_PROPERTY(QColor foregroundColor WRITE setForegroundColor READ foregroundColor) - Q_PROPERTY(QColor backgroundColor WRITE setBackgroundColor READ backgroundColor) - Q_PROPERTY(QColor overlayColor WRITE setOverlayColor READ overlayColor) - Q_PROPERTY( - QColor disabledForegroundColor WRITE setDisabledForegroundColor READ disabledForegroundColor) + Q_PROPERTY(QColor foregroundColor WRITE setForegroundColor READ foregroundColor NOTIFY + foregroundColorChanged) + Q_PROPERTY(QColor backgroundColor WRITE setBackgroundColor READ backgroundColor NOTIFY + backgroundColorChanged) Q_PROPERTY( - QColor disabledBackgroundColor WRITE setDisabledBackgroundColor READ disabledBackgroundColor) - Q_PROPERTY(qreal fontSize WRITE setFontSize READ fontSize) + QColor overlayColor WRITE setOverlayColor READ overlayColor NOTIFY overlayColorChanged) + Q_PROPERTY(QColor disabledForegroundColor WRITE setDisabledForegroundColor READ + disabledForegroundColor NOTIFY disabledForegroundColorChanged) + Q_PROPERTY(QColor disabledBackgroundColor WRITE setDisabledBackgroundColor READ + disabledBackgroundColor NOTIFY disabledBackgroundColorChanged) + Q_PROPERTY(qreal fontSize WRITE setFontSize READ fontSize NOTIFY fontSizeChanged) public: explicit FlatButton(QWidget *parent = nullptr, @@ -156,6 +163,14 @@ protected: void init(); +signals: + void foregroundColorChanged(); + void backgroundColorChanged(); + void overlayColorChanged(); + void disabledForegroundColorChanged(); + void disabledBackgroundColorChanged(); + void fontSizeChanged(); + private: RippleOverlay *ripple_overlay_; FlatButtonStateMachine *state_machine_;