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
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 6 deletions

View file

@ -5,6 +5,7 @@
- Minor: Channel name in `<channel> has gone offline. Exiting host mode.` messages is now clickable. (#2922)
- Minor: Added `/openurl` command. Usage: `/openurl <URL>`. Opens the provided URL in the browser. (#2461, #2926)
- Bugfix: Fixed large timeout durations in moderation buttons overlapping with usernames or other buttons. (#2865, #2921)
- Bugfix: Fix bad behavior of the HTML color picker edit when user input is being entered. (#2942)
## 2.3.3

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