mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2024-12-26 15:59:50 -05:00
Fixes regression introduced by 3b330ee
.
The previous changes could add an invalid style
sheet to PasswordEdit's QLineEdit.
This commit is contained in:
parent
a93b22f89a
commit
ca0c4f5a3d
@ -94,14 +94,14 @@ bool PasswordEdit::passwordsEqual() const
|
|||||||
|
|
||||||
void PasswordEdit::updateStylesheet()
|
void PasswordEdit::updateStylesheet()
|
||||||
{
|
{
|
||||||
QString stylesheet("QLineEdit { background: %1; }");
|
const QString stylesheetTemplate("QLineEdit { background: %1; }");
|
||||||
|
|
||||||
if (m_basePasswordEdit && !passwordsEqual()) {
|
if (m_basePasswordEdit && !passwordsEqual()) {
|
||||||
bool isCorrect = true;
|
bool isCorrect = true;
|
||||||
if (m_basePasswordEdit->text().startsWith(text())) {
|
if (m_basePasswordEdit->text().startsWith(text())) {
|
||||||
stylesheet = stylesheet.arg(CorrectSoFarColor.name());
|
setStyleSheet(stylesheetTemplate.arg(CorrectSoFarColor.name()));
|
||||||
} else {
|
} else {
|
||||||
stylesheet = stylesheet.arg(ErrorColor.name());
|
setStyleSheet(stylesheetTemplate.arg(ErrorColor.name()));
|
||||||
isCorrect = false;
|
isCorrect = false;
|
||||||
}
|
}
|
||||||
m_correctAction->setVisible(isCorrect);
|
m_correctAction->setVisible(isCorrect);
|
||||||
@ -109,9 +109,8 @@ void PasswordEdit::updateStylesheet()
|
|||||||
} else {
|
} else {
|
||||||
m_correctAction->setVisible(false);
|
m_correctAction->setVisible(false);
|
||||||
m_errorAction->setVisible(false);
|
m_errorAction->setVisible(false);
|
||||||
|
setStyleSheet("");
|
||||||
}
|
}
|
||||||
|
|
||||||
setStyleSheet(stylesheet);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void PasswordEdit::autocompletePassword(const QString& password)
|
void PasswordEdit::autocompletePassword(const QString& password)
|
||||||
|
Loading…
Reference in New Issue
Block a user