qt-material-widgets/components/toggle.h

39 lines
609 B
C
Raw Normal View History

2016-03-25 21:57:51 +00:00
#ifndef TOGGLE_H
#define TOGGLE_H
2016-03-26 10:37:48 +00:00
#include <QAbstractButton>
class RippleOverlay;
2016-03-26 12:42:21 +00:00
class Thumb : public QWidget
{
Q_OBJECT
public:
explicit Thumb(QWidget *parent = 0);
~Thumb();
2016-03-26 12:58:01 +00:00
protected:
void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE;
2016-03-26 12:42:21 +00:00
};
2016-03-26 10:37:48 +00:00
class Toggle : public QAbstractButton
{
Q_OBJECT
public:
explicit Toggle(QWidget *parent = 0);
~Toggle();
QSize sizeHint() const { return QSize(32, 32); }
2016-03-26 10:37:48 +00:00
protected:
void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE;
private:
RippleOverlay *const _overlay;
2016-03-26 12:58:01 +00:00
Thumb *const _thumb;
2016-03-26 10:37:48 +00:00
};
2016-03-25 21:57:51 +00:00
#endif // TOGGLE_H