summaryrefslogtreecommitdiffstats
path: root/mobile-widgets/qml
diff options
context:
space:
mode:
Diffstat (limited to 'mobile-widgets/qml')
-rw-r--r--mobile-widgets/qml/Settings.qml6
-rw-r--r--mobile-widgets/qml/ThemeTest.qml2
-rw-r--r--mobile-widgets/qml/main.qml17
3 files changed, 4 insertions, 21 deletions
diff --git a/mobile-widgets/qml/Settings.qml b/mobile-widgets/qml/Settings.qml
index 1310cdf6d..f4bc95db3 100644
--- a/mobile-widgets/qml/Settings.qml
+++ b/mobile-widgets/qml/Settings.qml
@@ -318,7 +318,7 @@ Kirigami.ScrollablePage {
enabled: subsurfaceTheme.currentScale !== 0.85
onClicked: {
PrefDisplay.mobile_scale = 0.85
- fontMetrics.font.pointSize = subsurfaceTheme.basePointSize * PrefDisplay.mobile_scale;
+ fontMetrics.font.pointSize = themeNew.basePointSize * PrefDisplay.mobile_scale;
}
}
SsrfButton {
@@ -326,7 +326,7 @@ Kirigami.ScrollablePage {
enabled: subsurfaceTheme.currentScale !== 1.0
onClicked: {
PrefDisplay.mobile_scale = 1.0
- fontMetrics.font.pointSize = subsurfaceTheme.basePointSize * PrefDisplay.mobile_scale;
+ fontMetrics.font.pointSize = themeNew.basePointSize * PrefDisplay.mobile_scale;
}
}
SsrfButton {
@@ -334,7 +334,7 @@ Kirigami.ScrollablePage {
enabled: subsurfaceTheme.currentScale !== 1.15
onClicked: {
PrefDisplay.mobile_scale = 1.15
- fontMetrics.font.pointSize = subsurfaceTheme.basePointSize * PrefDisplay.mobile_scale;
+ fontMetrics.font.pointSize = themeNew.basePointSize * PrefDisplay.mobile_scale;
}
}
}
diff --git a/mobile-widgets/qml/ThemeTest.qml b/mobile-widgets/qml/ThemeTest.qml
index 41b7e6345..583a7fbc5 100644
--- a/mobile-widgets/qml/ThemeTest.qml
+++ b/mobile-widgets/qml/ThemeTest.qml
@@ -65,7 +65,7 @@ Kirigami.Page {
text: "basePointSize:"
}
Controls.Label {
- text: subsurfaceTheme.basePointSize
+ text: ThemeNew.basePointSize
}
Controls.Label {
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