fix: provide better UX for HTML color picker edit (#2942)

This commit is contained in:
Leon Richardt
2021-07-02 21:53:24 +02:00
committed by GitHub
parent a8a07426b9
commit 0dd545fa15
2 changed files with 6 additions and 6 deletions
+5 -6
View File
@@ -365,12 +365,11 @@ void ColorPickerDialog::initHtmlColor(LayoutCreator<QWidget> &creator)
html->addWidget(htmlLabel, 0, 0);
html->addWidget(htmlEdit, 0, 1);
QObject::connect(htmlEdit, &QLineEdit::textEdited,
[=](const QString &text) {
QColor col(text);
if (col.isValid())
this->selectColor(col, false);
});
QObject::connect(htmlEdit, &QLineEdit::editingFinished, [this] {
const QColor col(this->ui_.picker.htmlEdit->text());
if (col.isValid())
this->selectColor(col, false);
});
}
} // namespace chatterino