Pencil2D  ff90c0872e88be3bf81c548cd60f01983012ec49
Pencil2D is an animation software for both bitmap and vector graphics. It is free, multi-platform, and open source.
 All Classes Functions
colorbox.h
1 /*
2 
3 Pencil - Traditional Animation Software
4 Copyright (C) 2012-2017 Matthew Chiawen Chang
5 
6 This program is free software; you can redistribute it and/or
7 modify it under the terms of the GNU General Public License
8 as published by the Free Software Foundation; version 2 of the License.
9 
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14 
15 */
16 #ifndef COLORBOX_H
17 #define COLORBOX_H
18 
19 #include "basedockwidget.h"
20 
21 class ColorWheel;
22 class ColorInspector;
23 
24 
25 class ColorBox : public BaseDockWidget
26 {
27  Q_OBJECT
28 
29 public:
30  explicit ColorBox( QWidget* parent );
31  virtual ~ColorBox();
32 
33  void initUI() override;
34  void updateUI() override;
35 
36  QColor color();
37  void setColor(const QColor&);
38 
39 Q_SIGNALS:
40  void colorChanged(const QColor&);
41 
42 private:
43  void onSpinboxChange(const QColor&);
44  void onWheelMove(const QColor&);
45  void onWheelRelease(const QColor&);
46 
47  ColorWheel* mColorWheel = nullptr;
48  ColorInspector* mColorInspector = nullptr;
49 };
50 
51 #endif // COLORBOX_H