subsurface/qt-mobile/ThemeTest.qml
Sebastian Kügler 7b320a7d34 Improve theme information panel
- add sizing information for fonts and fontmetrics
- compute devicePixelRatio from fontmetrics

This shows that Android doesn't give us accurate information about the
default font (hence the Text items being way too small) and a wrong
Screen.devicePixelRatio, which we can actually compute ourselves.

Signed-off-by: Sebastian Kügler <sebas@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-06 14:06:03 -08:00

58 lines
698 B
QML

import QtQuick 2.5
import QtQuick.Layouts 1.1
GridLayout {
id: themetest
columns: 2
Label {
Layout.columnSpan: 2
Layout.fillHeight: true
text: "Theme Information"
}
FontMetrics {
id: fm
}
Label {
text: "units.gridUnit:"
}
Label {
text: units.gridUnit
}
Label {
text: "units.devicePixelRatio:"
}
Label {
text: units.devicePixelRatio
}
Label {
text: "FontMetrics pointSize:"
}
Label {
text: fm.font.pointSize
}
Label {
text: "FontMetrics pixelSize:"
}
Label {
text: fm.height
}
Label {
text: "hand-computed devicePixelRatio:"
}
Label {
text: fm.height / fm.font.pointSize
}
Item {
Layout.columnSpan: 2
Layout.fillHeight: true
}
}