mirror of
https://github.com/ciphervance/supercell-wx.git
synced 2025-10-30 17:50:04 +00:00
Don't overwite the edit line color text boxes during text editing
This commit is contained in:
parent
88b8a8001f
commit
da79f47416
1 changed files with 11 additions and 4 deletions
|
|
@ -32,7 +32,7 @@ public:
|
|||
{
|
||||
boost::gil::rgba8_pixel_t color =
|
||||
util::color::ToRgba8PixelT(text.toStdString());
|
||||
self->p->set_color(*this, color);
|
||||
self->p->set_color(*this, color, false);
|
||||
});
|
||||
|
||||
QObject::connect(colorButton_,
|
||||
|
|
@ -65,7 +65,9 @@ public:
|
|||
void ShowColorDialog(EditComponent& component);
|
||||
void UpdateLineLabel();
|
||||
|
||||
void set_color(EditComponent& component, boost::gil::rgba8_pixel_t color);
|
||||
void set_color(EditComponent& component,
|
||||
boost::gil::rgba8_pixel_t color,
|
||||
bool updateLineEdit = true);
|
||||
void set_width(EditComponent& component, std::size_t width);
|
||||
|
||||
static void SetBackgroundColor(const std::string& value, QFrame* frame);
|
||||
|
|
@ -207,14 +209,19 @@ void EditLineDialog::set_line_width(std::size_t width)
|
|||
}
|
||||
|
||||
void EditLineDialog::Impl::set_color(EditComponent& component,
|
||||
boost::gil::rgba8_pixel_t color)
|
||||
boost::gil::rgba8_pixel_t color,
|
||||
bool updateLineEdit)
|
||||
{
|
||||
const std::string argbString {util::color::ToArgbString(color)};
|
||||
|
||||
component.color_ = color;
|
||||
component.colorLineEdit_->setText(QString::fromStdString(argbString));
|
||||
SetBackgroundColor(argbString, component.colorFrame_);
|
||||
|
||||
if (updateLineEdit)
|
||||
{
|
||||
component.colorLineEdit_->setText(QString::fromStdString(argbString));
|
||||
}
|
||||
|
||||
UpdateLineLabel();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue