Skip to content

Commit

Permalink
Fix display of passwords in preview panel
Browse files Browse the repository at this point in the history
* Fix #8627 - don't HTML escape plain text...
* Fix #8624 - ensure use of monospace font when displaying passwords in preview panel
  • Loading branch information
droidmonkey committed Oct 25, 2022
1 parent d83743e commit 422fd91
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/gui/EntryPreviewWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,8 @@ void EntryPreviewWidget::setUsernameVisible(bool state)

void EntryPreviewWidget::setPasswordVisible(bool state)
{
m_ui->entryPasswordLabel->setFont(Font::fixedFont());

const QString password = m_currentEntry->resolveMultiplePlaceholders(m_currentEntry->password());
if (state) {
if (config()->get(Config::GUI_ColorPasswords).toBool()) {
Expand All @@ -268,15 +270,14 @@ void EntryPreviewWidget::setPasswordVisible(bool state)
m_ui->entryPasswordLabel->setHtml(html);
} else {
// No color
m_ui->entryPasswordLabel->setPlainText(password.toHtmlEscaped());
m_ui->entryPasswordLabel->setPlainText(password);
}
} else if (password.isEmpty() && !config()->get(Config::Security_PasswordEmptyPlaceholder).toBool()) {
m_ui->entryPasswordLabel->setPlainText("");
} else {
m_ui->entryPasswordLabel->setPlainText(QString("\u25cf").repeated(6));
}

m_ui->entryPasswordLabel->setFont(Font::fixedFont());
m_ui->togglePasswordButton->setIcon(icons()->onOffIcon("password-show", state));
}

Expand Down

0 comments on commit 422fd91

Please sign in to comment.