diff options
author | jan Iversen <jan@casacondor.com> | 2020-01-14 13:10:07 +0100 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2020-01-30 07:51:05 +0200 |
commit | a3e3a30b701370ec8e35f5cb3d1072642a2f44b1 (patch) | |
tree | 24066ddec3e77394eedc278c0ac97216a508e3ab /mobile-widgets/themeinterface.cpp | |
parent | 08e39f9d2d293ac22e6174e7b723abb805650552 (diff) | |
download | subsurface-a3e3a30b701370ec8e35f5cb3d1072642a2f44b1.tar.gz |
mobile-widgets: move basePointSize to themeinterface
Check defaultfont and calculate basepointsize in themeinterface instead
of in QML.
Signed-off-by: jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'mobile-widgets/themeinterface.cpp')
-rw-r--r-- | mobile-widgets/themeinterface.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/mobile-widgets/themeinterface.cpp b/mobile-widgets/themeinterface.cpp index 2d87a9d29..ba72bb7f7 100644 --- a/mobile-widgets/themeinterface.cpp +++ b/mobile-widgets/themeinterface.cpp @@ -1,5 +1,7 @@ // SPDX-License-Identifier: GPL-2.0 #include "themeinterface.h" +#include "qmlmanager.h" +#include "core/metrics.h" #include "core/settings/qPrefDisplay.h" themeInterface *themeInterface::instance() @@ -16,6 +18,12 @@ void themeInterface::setup(QQmlContext *ct) // get current theme instance()->m_currentTheme = qPrefDisplay::theme(); instance()->update_theme(); + + // check system font + instance()->m_basePointSize = defaultModelFont().pointSize(); + + // set initial font size + defaultModelFont().setPointSize(m_basePointSize * qPrefDisplay::mobile_scale()); } void themeInterface::set_currentTheme(const QString &theme) |