mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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:
parent
08e39f9d2d
commit
a3e3a30b70
5 changed files with 17 additions and 21 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue