summaryrefslogtreecommitdiffstats
path: root/mobile-widgets
diff options
context:
space:
mode:
authorGravatar Jan Mulder <jlmulder@xs4all.nl>2018-09-25 12:33:19 +0200
committerGravatar Jan Mulder <jlmulder@xs4all.nl>2018-09-25 16:01:39 +0200
commita9c6b1472b08c2c279dbad74a20bec4f3b33d1e7 (patch)
tree6f8d2bee55b3fc1dea494a3e8e94be4c823dd6e0 /mobile-widgets
parent5480d08d15aca6710ad900b5084d786798bef7ab (diff)
downloadsubsurface-a9c6b1472b08c2c279dbad74a20bec4f3b33d1e7.tar.gz
mobile, QML: do not user a local font metric object
This theme test display created a new local FontMetrics object, that does not per definition correspond with the "global" font metric as defined in main.qml. The fix is simple. Display the font theme data based on the one and only font metric from main.qml Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
Diffstat (limited to 'mobile-widgets')
-rw-r--r--mobile-widgets/qml/ThemeTest.qml16
1 files changed, 7 insertions, 9 deletions
diff --git a/mobile-widgets/qml/ThemeTest.qml b/mobile-widgets/qml/ThemeTest.qml
index a5327c058..1109435ef 100644
--- a/mobile-widgets/qml/ThemeTest.qml
+++ b/mobile-widgets/qml/ThemeTest.qml
@@ -4,6 +4,7 @@ import QtQuick.Layouts 1.2
import QtQuick.Controls 2.2 as Controls
import QtQuick.Window 2.2
import org.kde.kirigami 2.2 as Kirigami
+import org.subsurfacedivelog.mobile 1.0
Kirigami.Page {
@@ -25,9 +26,6 @@ Kirigami.Page {
Layout.columnSpan: 2
level: 3
}
- FontMetrics {
- id: fm
- }
Controls.Label {
text: "Geometry (pixels):"
@@ -67,35 +65,35 @@ Kirigami.Page {
text: "FontMetrics pointSize:"
}
Controls.Label {
- text: fm.font.pointSize
+ text: fontMetrics.font.pointSize
}
Controls.Label {
text: "FontMetrics pixelSize:"
}
Controls.Label {
- text: Number(fm.height).toFixed(2)
+ text: Number(fontMetrics.height).toFixed(2)
}
Controls.Label {
text: "FontMetrics devicePixelRatio:"
}
Controls.Label {
- text: Number(fm.height / fm.font.pointSize).toFixed(2)
+ text: Number(fontMetrics.height / fontMetrics.font.pointSize).toFixed(2)
}
Controls.Label {
text: "Text item pixelSize:"
}
Text {
- text: font.pixelSize
+ text: fontMetrics.font.pixelSize
}
Controls.Label {
text: "Text item pointSize:"
}
Text {
- text: font.pointSize
+ text: fontMetrics.font.pointSize
}
Controls.Label {
@@ -109,7 +107,7 @@ Kirigami.Page {
text: "Height of default font:"
}
Text {
- text: Number(font.pixelSize / Screen.pixelDensity).toFixed(2) + "mm"
+ text: Number(fontMetrics.font.pixelSize / Screen.pixelDensity).toFixed(2) + "mm"
}
Controls.Label {