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>
This commit is contained in:
Dirk Hohndel 2016-09-20 06:42:34 -07:00
parent fd27c3fa23
commit 13dbbd3085

View file

@ -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