Don't make font size of password strength labels smaller than 8pt, resolves #228

This commit is contained in:
Janek Bevendorff 2017-01-27 17:44:40 +01:00
parent 7b2a9f7ea8
commit cdc9fddc44
No known key found for this signature in database
GPG Key ID: CFEC2F6850BFFA53

View File

@ -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<int>(defaultFont.pointSize() * 0.8f));
int smallerSize = static_cast<int>(defaultFont.pointSize() * 0.8f);
if (smallerSize >= 8) {
defaultFont.setPointSize(smallerSize);
m_ui->entropyLabel->setFont(defaultFont);
m_ui->strengthLabel->setFont(defaultFont);
}
loadSettings();
reset();