colordialog/wheel/gradient: implemented basic UI components for color picking
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user