From 13dbbd3085cf450f50aa28473571de572eeba26b Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Tue, 20 Sep 2016 06:42:34 -0700 Subject: QML UI: smaller fonts on narrow screens This may be excessive, but it fixes the issue with the German localization on some narrow screens. Signed-off-by: Dirk Hohndel --- mobile-widgets/qml/main.qml | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'mobile-widgets/qml') diff --git a/mobile-widgets/qml/main.qml b/mobile-widgets/qml/main.qml index 1df958302..505ed937b 100644 --- a/mobile-widgets/qml/main.qml +++ b/mobile-widgets/qml/main.qml @@ -42,6 +42,13 @@ Kirigami.ApplicationWindow { FontMetrics { id: fontMetrics + Component.onCompleted: { + if (Math.round(rootItem.width / Kirigami.Units.gridUnit) < 20) { + fontMetrics.font.pointSize = fontMetrics.font.pointSize * 2 / 3 + Kirigami.Theme.defaultFont.pointSize = fontMetrics.font.pointSize + console.log("Reduce font size for narrow screens: " + fontMetrics.font.pointSize) + } + } } visible: false -- cgit v1.2.3-70-g09d2