colordialog/wheel/gradient: implemented basic UI components for color picking

This commit is contained in:
itsmattkc
2020-04-02 13:02:30 +11:00
parent 3bec108fee
commit f3290003be
27 changed files with 792 additions and 27 deletions
+3 -1
View File
@@ -5,11 +5,13 @@
ColorButton::ColorButton(QWidget *parent) :
QPushButton(parent)
{
color_ = Color(1.0f, 1.0f, 1.0f);
connect(this, &ColorButton::clicked, this, &ColorButton::ShowColorDialog);
}
void ColorButton::ShowColorDialog()
{
ColorDialog cd(nullptr);
ColorDialog cd(nullptr, color_, this);
cd.exec();
}
+5
View File
@@ -3,6 +3,8 @@
#include <QPushButton>
#include "render/color.h"
class ColorButton : public QPushButton
{
Q_OBJECT
@@ -15,6 +17,9 @@ signals:
private slots:
void ShowColorDialog();
private:
Color color_;
};
#endif // COLORBUTTON_H