diff --git a/src/gui/PasswordGeneratorWidget.cpp b/src/gui/PasswordGeneratorWidget.cpp index 9f2bf31ce..4a4b438e3 100644 --- a/src/gui/PasswordGeneratorWidget.cpp +++ b/src/gui/PasswordGeneratorWidget.cpp @@ -45,11 +45,15 @@ PasswordGeneratorWidget::PasswordGeneratorWidget(QWidget* parent) connect(m_ui->optionButtons, SIGNAL(buttonClicked(int)), SLOT(updateGenerator())); - // set font size of password quality and entropy labels dynamically to 80% of the default font size + // set font size of password quality and entropy labels dynamically to 80% of + // the default font size, but make it no smaller than 8pt QFont defaultFont; - defaultFont.setPointSize(static_cast(defaultFont.pointSize() * 0.8f)); - m_ui->entropyLabel->setFont(defaultFont); - m_ui->strengthLabel->setFont(defaultFont); + int smallerSize = static_cast(defaultFont.pointSize() * 0.8f); + if (smallerSize >= 8) { + defaultFont.setPointSize(smallerSize); + m_ui->entropyLabel->setFont(defaultFont); + m_ui->strengthLabel->setFont(defaultFont); + } loadSettings(); reset(); diff --git a/src/gui/PasswordGeneratorWidget.ui b/src/gui/PasswordGeneratorWidget.ui index a2e798abf..7ca7b1deb 100644 --- a/src/gui/PasswordGeneratorWidget.ui +++ b/src/gui/PasswordGeneratorWidget.ui @@ -104,11 +104,6 @@ QProgressBar::chunk { 30 - - - 8 - - strength @@ -144,11 +139,6 @@ QProgressBar::chunk { 0 - - - 8 - - entropy