mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-30 22:20:21 +00:00
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>
This commit is contained in:
parent
cdcb5c1603
commit
7b320a7d34
1 changed files with 48 additions and 5 deletions
|
@ -1,15 +1,58 @@
|
||||||
import QtQuick 2.5
|
import QtQuick 2.5
|
||||||
import QtQuick.Layouts 1.1
|
import QtQuick.Layouts 1.1
|
||||||
|
|
||||||
ColumnLayout {
|
GridLayout {
|
||||||
id: themetest
|
id: themetest
|
||||||
|
columns: 2
|
||||||
|
|
||||||
Text {
|
Label {
|
||||||
text: "units.gridUnit is: " + units.gridUnit
|
Layout.columnSpan: 2
|
||||||
|
Layout.fillHeight: true
|
||||||
|
text: "Theme Information"
|
||||||
}
|
}
|
||||||
|
|
||||||
Text {
|
FontMetrics {
|
||||||
text: "units.devicePixelRatio: " + units.devicePixelRatio
|
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
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue