diff options
author | Jedidiah Barber <contact@jedbarber.id.au> | 2021-07-14 11:49:10 +1200 |
---|---|---|
committer | Jedidiah Barber <contact@jedbarber.id.au> | 2021-07-14 11:49:10 +1200 |
commit | d24f813f3f2a05c112e803e4256b53535895fc98 (patch) | |
tree | 601e6ae9a1cd44bcfdcf91739a5ca36aedd827c9 /src/settings/ColorBox.h |
Diffstat (limited to 'src/settings/ColorBox.h')
-rw-r--r-- | src/settings/ColorBox.h | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/settings/ColorBox.h b/src/settings/ColorBox.h new file mode 100644 index 0000000..5844610 --- /dev/null +++ b/src/settings/ColorBox.h @@ -0,0 +1,28 @@ +#ifndef COLOR_BOX_H +#define COLOR_BOX_H + +#include <QtWidgets> + +class ColorBox: public QFrame +{ + Q_OBJECT + +public: + ColorBox( QColor aColor = Qt::white ); + QColor color() const { return m_color; } + void setColor( QColor aColor ); + +protected: + void mousePressEvent ( QMouseEvent* event ); + void changeEvent ( QEvent* event ); + +signals: + void colorChanged( QColor aColor ); + +private: + static const int MinHeight = 25; + static const int MinWidth = 50; + QColor m_color; +}; + +#endif |