From da79f47416c09806706d5d77e6a095448262391d Mon Sep 17 00:00:00 2001 From: Dan Paulat Date: Wed, 21 Aug 2024 22:24:07 -0500 Subject: [PATCH] Don't overwite the edit line color text boxes during text editing --- scwx-qt/source/scwx/qt/ui/edit_line_dialog.cpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/scwx-qt/source/scwx/qt/ui/edit_line_dialog.cpp b/scwx-qt/source/scwx/qt/ui/edit_line_dialog.cpp index 1aafffeb..5202e732 100644 --- a/scwx-qt/source/scwx/qt/ui/edit_line_dialog.cpp +++ b/scwx-qt/source/scwx/qt/ui/edit_line_dialog.cpp @@ -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(); }