diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2016-09-20 06:42:34 -0700 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2016-09-20 08:47:08 -0700 |
commit | 13dbbd3085cf450f50aa28473571de572eeba26b (patch) | |
tree | 074106da99830c00635fe47a2a913abf5be08c9c /mobile-widgets/qml/main.qml | |
parent | fd27c3fa23cd9f96648ad84b969287c031ebce03 (diff) | |
download | subsurface-13dbbd3085cf450f50aa28473571de572eeba26b.tar.gz |
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 <dirk@hohndel.org>
Diffstat (limited to 'mobile-widgets/qml/main.qml')
-rw-r--r-- | mobile-widgets/qml/main.qml | 7 |
1 files changed, 7 insertions, 0 deletions
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 |