Merge pull request #230 from keepassxreboot/hotfix/228-password-generator-text-size

Don't make font size of password strength labels smaller than 8pt, resolves #228
This commit is contained in:
Janek Bevendorff 2017-01-27 19:47:03 +02:00 committed by GitHub
commit 202e8ac3a1
2 changed files with 8 additions and 14 deletions

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();

View File

@ -104,11 +104,6 @@ QProgressBar::chunk {
<height>30</height>
</size>
</property>
<property name="font">
<font>
<pointsize>8</pointsize>
</font>
</property>
<property name="text">
<string>strength</string>
</property>
@ -144,11 +139,6 @@ QProgressBar::chunk {
<height>0</height>
</size>
</property>
<property name="font">
<font>
<pointsize>8</pointsize>
</font>
</property>
<property name="text">
<string>entropy</string>
</property>