Prevent password preview from being cut off

* Fixes #9190
This commit is contained in:
Jonathan White committed 2023-08-06 15:26:33 -04:00
1 parent 15b8b5d92f
commit a35f446585
2 files changed
+286 -274

No files matched your search

+9 -4
View File
@@ -30,6 +30,8 @@
#include "keeshare/KeeShareSettings.h"
#endif
#include <QScrollBar>
namespace
{
constexpr int GeneralTabIndex = 0;
@@ -286,17 +288,20 @@ void EntryPreviewWidget::setPasswordVisible(bool state)
html += "<span style=\"color: " + QString(color) + ";\">" + QString(c).toHtmlEscaped() + "</span>";
}
// clang-format on
m_ui->entryPasswordLabel->setHtml(html);
m_ui->entryPasswordLabel->setText(html);
} else {
// No color
m_ui->entryPasswordLabel->setPlainText(password);
m_ui->entryPasswordLabel->setText(password);
}
} else if (password.isEmpty() && !config()->get(Config::Security_PasswordEmptyPlaceholder).toBool()) {
m_ui->entryPasswordLabel->setPlainText("");
m_ui->entryPasswordLabel->setText("");
} else {
m_ui->entryPasswordLabel->setPlainText(QString("\u25cf").repeated(6));
m_ui->entryPasswordLabel->setText(QString("\u25cf").repeated(6));
}
m_ui->passwordScrollArea->setMaximumHeight(m_ui->entryPasswordLabel->sizeHint().height()
+ m_ui->passwordScrollArea->horizontalScrollBar()->sizeHint().height());
m_ui->togglePasswordButton->setIcon(icons()->onOffIcon("password-show", state));
}