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/qml/main.qml | |
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/qml/main.qml')
-rw-r--r-- | mobile-widgets/qml/main.qml | 17 |
1 files changed, 0 insertions, 17 deletions
diff --git a/mobile-widgets/qml/main.qml b/mobile-widgets/qml/main.qml index f4b26e38b..ab9248ddf 100644 --- a/mobile-widgets/qml/main.qml +++ b/mobile-widgets/qml/main.qml @@ -48,11 +48,6 @@ Kirigami.ApplicationWindow { } FontMetrics { id: fontMetrics - Component.onCompleted: { - manager.appendTextToLog("Using the following font: " + fontMetrics.font.family + - " at " + subsurfaceTheme.basePointSize + "pt" + - " with mobile_scale: " + PrefDisplay.mobile_scale) - } } visible: false @@ -595,24 +590,12 @@ if you have network connectivity and want to sync your data to cloud storage."), // change our glabal grid unit Kirigami.Units.gridUnit = kirigamiGridUnit } - // break binding explicitly. Now we have a basePointSize that we can - // use to easily scale against - subsurfaceTheme.basePointSize = subsurfaceTheme.basePointSize * factor; - - // set the initial UI scaling as in the the preferences - fontMetrics.font.pointSize = subsurfaceTheme.basePointSize * PrefDisplay.mobile_scale; manager.appendTextToLog("Done setting up sizes") } QtObject { id: subsurfaceTheme - // basePointSize is determinded based on the width of the screen (typically at start of the app) - // and must not be changed if we change font size. This is tricky in QML. In order to break the - // binding between basePointSize and fontMetrics.font.pointSize we explicitly multipy it by 1.0 - // in the onComplete handler of this object. - property double basePointSize: fontMetrics.font.pointSize; - property double regularPointSize: fontMetrics.font.pointSize property double titlePointSize: regularPointSize * 1.5 property double headingPointSize: regularPointSize * 1.2 |