mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2026-12-04 07:42:35 -08:00
Fix password font size not changing
* Move font size application to showEvent instead of constructor to enable dynamic font size application if changed in app settings.
This commit is contained in:
1 parent
126f508e6a
commit
f2003b4087
2 files changed
+13
-5
No files matched your search
@@ -52,11 +52,6 @@ PasswordWidget::PasswordWidget(QWidget* parent)
|
||||
|
||||
setEchoMode(QLineEdit::Password);
|
||||
|
||||
// use a monospace font for the password field
|
||||
QFont passwordFont = Font::fixedFont();
|
||||
passwordFont.setLetterSpacing(QFont::PercentageSpacing, 110);
|
||||
m_ui->passwordEdit->setFont(passwordFont);
|
||||
|
||||
// Prevent conflicts with global Mac shortcuts (force Control on all platforms)
|
||||
#ifdef Q_OS_MAC
|
||||
constexpr auto modifier = Qt::MetaModifier;
|
||||
@@ -244,6 +239,16 @@ bool PasswordWidget::eventFilter(QObject* watched, QEvent* event)
|
||||
return false;
|
||||
}
|
||||
|
||||
void PasswordWidget::showEvent(QShowEvent* event)
|
||||
{
|
||||
QWidget::showEvent(event);
|
||||
|
||||
// use a monospace font for the password field
|
||||
QFont passwordFont = Font::fixedFont();
|
||||
passwordFont.setLetterSpacing(QFont::PercentageSpacing, 110);
|
||||
m_ui->passwordEdit->setFont(passwordFont);
|
||||
}
|
||||
|
||||
void PasswordWidget::checkCapslockState()
|
||||
{
|
||||
if (m_parentPasswordWidget) {
|
||||
|
||||
@@ -60,6 +60,9 @@ public slots:
|
||||
void setEchoMode(QLineEdit::EchoMode mode);
|
||||
void setClearButtonEnabled(bool enabled);
|
||||
|
||||
protected:
|
||||
void showEvent(QShowEvent* event) override;
|
||||
|
||||
private slots:
|
||||
void popupPasswordGenerator();
|
||||
void updateRepeatStatus();
|
||||
|
||||
Reference in new issue
Block a user