From 2cc215d3f26788974b1d5c552cb3750ad6bf8d85 Mon Sep 17 00:00:00 2001 From: jan Iversen Date: Tue, 14 Jan 2020 19:30:47 +0100 Subject: mobile-widgets: move font property to themeInterface Move setting of font properties used throughout to themeInterface. Add new settings "currentScale". The properties are kept in main (subsurfaceTheme) in order not to do a big search/replace. Update settings to use currectScale and signal changes in themeinterface. Signed-off-by: jan Iversen Signed-off-by: Dirk Hohndel --- mobile-widgets/qml/Settings.qml | 15 ++++++--------- mobile-widgets/qml/main.qml | 8 ++++---- 2 files changed, 10 insertions(+), 13 deletions(-) (limited to 'mobile-widgets/qml') diff --git a/mobile-widgets/qml/Settings.qml b/mobile-widgets/qml/Settings.qml index f4bc95db3..cc2034bc9 100644 --- a/mobile-widgets/qml/Settings.qml +++ b/mobile-widgets/qml/Settings.qml @@ -315,26 +315,23 @@ Kirigami.ScrollablePage { spacing: Kirigami.Units.largeSpacing SsrfButton { text: qsTr("smaller") - enabled: subsurfaceTheme.currentScale !== 0.85 + enabled: ThemeNew.currentScale !== 0.85 onClicked: { - PrefDisplay.mobile_scale = 0.85 - fontMetrics.font.pointSize = themeNew.basePointSize * PrefDisplay.mobile_scale; + ThemeNew.currentScale = 0.85 } } SsrfButton { text: qsTr("regular") - enabled: subsurfaceTheme.currentScale !== 1.0 + enabled: ThemeNew.currentScale !== 1.0 onClicked: { - PrefDisplay.mobile_scale = 1.0 - fontMetrics.font.pointSize = themeNew.basePointSize * PrefDisplay.mobile_scale; + ThemeNew.currentScale = 1.0 } } SsrfButton { text: qsTr("larger") - enabled: subsurfaceTheme.currentScale !== 1.15 + enabled: ThemeNew.currentScale !== 1.15 onClicked: { - PrefDisplay.mobile_scale = 1.15 - fontMetrics.font.pointSize = themeNew.basePointSize * PrefDisplay.mobile_scale; + ThemeNew.currentScale = 1.15 } } } diff --git a/mobile-widgets/qml/main.qml b/mobile-widgets/qml/main.qml index ab9248ddf..be6cfaff2 100644 --- a/mobile-widgets/qml/main.qml +++ b/mobile-widgets/qml/main.qml @@ -596,10 +596,10 @@ if you have network connectivity and want to sync your data to cloud storage."), QtObject { id: subsurfaceTheme - property double regularPointSize: fontMetrics.font.pointSize - property double titlePointSize: regularPointSize * 1.5 - property double headingPointSize: regularPointSize * 1.2 - property double smallPointSize: regularPointSize * 0.8 + property double regularPointSize: ThemeNew.regularPointSize + property double titlePointSize: ThemeNew.titlePointSize + property double headingPointSize: ThemeNew.headingPointSize + property double smallPointSize: ThemeNew.smallPointSize // colors currently in use property color darkerPrimaryColor: ThemeNew.darkerPrimaryColor -- cgit v1.2.3-70-g09d2