aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Sebastian Kügler <sebas@kde.org>2015-11-06 21:54:54 +0000
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-11-06 14:06:03 -0800
commit7b320a7d340bef9d12ab7bce7c5a7215023db140 (patch)
treedd6f7927424b1574aa40c6ce301662faa86498e3
parentcdcb5c1603fb4f47833b3da920b4961a32bc3adb (diff)
downloadsubsurface-7b320a7d340bef9d12ab7bce7c5a7215023db140.tar.gz
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>
-rw-r--r--qt-mobile/ThemeTest.qml53
1 files changed, 48 insertions, 5 deletions
diff --git a/qt-mobile/ThemeTest.qml b/qt-mobile/ThemeTest.qml
index 55c15ed77..c848f1aa8 100644
--- a/qt-mobile/ThemeTest.qml
+++ b/qt-mobile/ThemeTest.qml
@@ -1,15 +1,58 @@
import QtQuick 2.5
import QtQuick.Layouts 1.1
-ColumnLayout {
+GridLayout {
id: themetest
+ columns: 2
- Text {
- text: "units.gridUnit is: " + units.gridUnit
+ Label {
+ Layout.columnSpan: 2
+ Layout.fillHeight: true
+ text: "Theme Information"
}
- Text {
- text: "units.devicePixelRatio: " + units.devicePixelRatio
+ 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
}
}