qt-material-widgets/components/flatbutton_internal.h

42 lines
992 B
C
Raw Normal View History

2016-05-15 07:08:23 +00:00
#ifndef FLATBUTTON_INTERNAL_H
#define FLATBUTTON_INTERNAL_H
2016-05-15 09:17:07 +00:00
#include <QStateMachine>
#include <QColor>
class FlatButton;
class FlatButtonDelegate : public QStateMachine
{
Q_OBJECT
Q_PROPERTY(qreal backgroundOpacity WRITE setBackgroundOpacity READ backgroundOpacity)
Q_PROPERTY(QColor backgroundColor WRITE setBackgroundColor READ backgroundColor)
public:
FlatButtonDelegate(FlatButton *parent);
~FlatButtonDelegate();
void setBackgroundOpacity(qreal opacity);
qreal backgroundOpacity() const;
void setBackgroundColor(const QColor &color);
QColor backgroundColor() const;
void assignProperties();
2016-05-15 09:17:07 +00:00
private:
Q_DISABLE_COPY(FlatButtonDelegate)
FlatButton *const button;
QState *const _normalState;
2016-05-27 14:12:16 +00:00
QState *const _hoveredState;
QState *const _focusedState2;
QState *const _pressedState;
qreal _backgroundOpacity;
QColor _backgroundColor;
2016-05-15 09:17:07 +00:00
};
2016-05-15 07:08:23 +00:00
#endif // FLATBUTTON_INTERNAL_H