ckb-next  v0.2.8 at branch master
ckb-next driver for corsair devices
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
colorbutton.h
Go to the documentation of this file.
1 #ifndef COLORBUTTON_H
2 #define COLORBUTTON_H
3 
4 #include <QPushButton>
5 
6 class ColorButton : public QPushButton
7 {
8  Q_OBJECT
9 public:
10  explicit ColorButton(QWidget* parent = 0, bool allowAlpha = false);
11 
12  // Current color
13  inline const QColor& color() const { return _color; }
14  void color(const QColor& newColor);
15 
16  // Enable alpha channel?
17  inline bool allowAlpha() const { return _alpha; }
18  void allowAlpha(bool newAllowAlpha);
19  // Whether or not to set the label based on the current color
20  inline bool setLabel() const { return _setLabel; }
21  inline void setLabel(bool newSetLabel) { _setLabel = newSetLabel; }
22  // Whether to use big icons (24x24) or small icons (24x12)
23  inline bool bigIcons() const { return _bigIcons; }
24  void bigIcons(bool newBigIcons);
25 
26 signals:
27  void colorChanged(QColor newColor);
28 
29 private slots:
30  void pickColor();
31 
32 private:
33  QColor _color;
35 
36  void updateImage();
37 };
38 
39 #endif // COLORBUTTON_H
void setLabel(bool newSetLabel)
Definition: colorbutton.h:21
const QColor & color() const
Definition: colorbutton.h:13
QColor _color
Definition: colorbutton.h:33
void pickColor()
Definition: colorbutton.cpp:60
void colorChanged(QColor newColor)
bool allowAlpha() const
Definition: colorbutton.h:17
bool _bigIcons
Definition: colorbutton.h:34
void updateImage()
Definition: colorbutton.cpp:32
bool _setLabel
Definition: colorbutton.h:34
ColorButton(QWidget *parent=0, bool allowAlpha=false)
Definition: colorbutton.cpp:5
bool bigIcons() const
Definition: colorbutton.h:23
bool setLabel() const
Definition: colorbutton.h:20