--- a/widgets/colorbutton.cpp Sat Apr 08 15:08:19 2023 +0300 +++ b/widgets/colorbutton.cpp Sat Apr 08 15:11:39 2023 +0300 @@ -2,13 +2,13 @@ #include <QHBoxLayout> #include "widgets/colorbutton.h" -ColorButton::ColorButton(const QColor& color, QWidget* parent) : - ColorButton{parent} +ColorEdit::ColorEdit(const QColor& color, QWidget* parent) : + ColorEdit{parent} { this->setColor(color); } -ColorButton::ColorButton(QWidget* parent) : +ColorEdit::ColorEdit(QWidget* parent) : QWidget{parent}, lineEdit{new QLineEdit{this}}, button{new QPushButton{"…", this}} @@ -38,12 +38,12 @@ this->setColor(Qt::black); } -QColor ColorButton::color() const +QColor ColorEdit::color() const { return QColor{this->lineEdit->text()}; } -void ColorButton::setColor(const QColor& color) +void ColorEdit::setColor(const QColor& color) { if (color.isValid() and this->color() != color) { this->lineEdit->setText(color.name());