Fix system default font handling

We didn't care about system default fonts and sizes, we just used the Qt
default font.

Due to how QFont is constructed, there was need to split font and font
size.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Anton Lundin 2014-03-21 18:56:10 +01:00 committed by Dirk Hohndel
parent 41209005c9
commit 9cfc585563
6 changed files with 11 additions and 5 deletions

View file

@ -645,8 +645,9 @@ void MainWindow::readSettings()
{
QSettings s;
s.beginGroup("Display");
QFont defaultFont = s.value("divelist_font", qApp->font()).value<QFont>();
defaultFont.setPointSizeF(s.value("font_size", qApp->font().pointSizeF()).toFloat());
QFont defaultFont = QFont(default_prefs.divelist_font);
defaultFont = s.value("divelist_font", defaultFont).value<QFont>();
defaultFont.setPointSizeF(s.value("font_size", default_prefs.font_size).toFloat());
qApp->setFont(defaultFont);
s.endGroup();