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>
This commit is contained in:
jan Iversen 2020-01-14 13:10:07 +01:00 committed by Dirk Hohndel
parent 08e39f9d2d
commit a3e3a30b70
5 changed files with 17 additions and 21 deletions

View file

@ -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)