summaryrefslogtreecommitdiffstats
path: root/mobile-widgets/qml/ThemeTest.qml
diff options
context:
space:
mode:
authorGravatar Jan Mulder <jlmulder@xs4all.nl>2018-09-25 12:48:48 +0200
committerGravatar Jan Mulder <jlmulder@xs4all.nl>2018-09-25 16:01:39 +0200
commitc2c751c164f3aca50a41b318e240dbcd0722ac1a (patch)
treeb791aa5235e62bf25c1221cd786352bdc8bab05b /mobile-widgets/qml/ThemeTest.qml
parenta9c6b1472b08c2c279dbad74a20bec4f3b33d1e7 (diff)
downloadsubsurface-c2c751c164f3aca50a41b318e240dbcd0722ac1a.tar.gz
mobile, QML: introduce basePointSize in subsurfaceTheme
By manipulation the used font pointSize property, we can dynamically scale fonts and derived UI objects. At the same time, we have some logic to determine the default font, its size, etc, for example depending on screen properties. The scaling of the UI (and its font) does not need to interfere with those defaults. However, when we want to reset the pointSize, we alter the default, so a backup of the default is needed. Ok, not al full backup, as the only thing we like to manipulate is the pointSize, to which we want to be able to return. All this leads to this commit. A basePointSize property is added, that is initialized from the default. Due to the binding logic of the QML engine, it is not a classic initialization, but a binding between the 2 properties. We need to break that binding explicitly, so that the original PointSize is always preserved. In addition, a display of the new font property is added to the developers theme test. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
Diffstat (limited to 'mobile-widgets/qml/ThemeTest.qml')
-rw-r--r--mobile-widgets/qml/ThemeTest.qml7
1 files changed, 7 insertions, 0 deletions
diff --git a/mobile-widgets/qml/ThemeTest.qml b/mobile-widgets/qml/ThemeTest.qml
index 1109435ef..bca847d24 100644
--- a/mobile-widgets/qml/ThemeTest.qml
+++ b/mobile-widgets/qml/ThemeTest.qml
@@ -62,6 +62,13 @@ Kirigami.Page {
}
Controls.Label {
+ text: "basePointSize:"
+ }
+ Controls.Label {
+ text: subsurfaceTheme.basePointSize
+ }
+
+ Controls.Label {
text: "FontMetrics pointSize:"
}
Controls.Label {