mobile/cleanup: make theme test page work in dark mode

Not really user visible, but still, that looked ridiculous.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2021-01-18 09:30:03 -08:00
parent 35f1b9e204
commit f678be0374

View file

@ -23,139 +23,143 @@ Kirigami.Page {
Kirigami.Heading { Kirigami.Heading {
Layout.columnSpan: 2 Layout.columnSpan: 2
text: "Theme Information" text: "Theme Information"
color: subsurfaceTheme.textColor
} }
Kirigami.Heading { Kirigami.Heading {
text: "Screen" text: "Screen"
color: subsurfaceTheme.textColor
Layout.columnSpan: 2 Layout.columnSpan: 2
level: 3 level: 3
} }
Controls.Label { TemplateLabel {
text: "Geometry (pixels):" text: "Geometry (pixels):"
} }
Controls.Label { TemplateLabel {
text: rootItem.width + "x" + rootItem.height text: rootItem.width + "x" + rootItem.height
} }
Controls.Label { TemplateLabel {
text: "Geometry (gridUnits):" text: "Geometry (gridUnits):"
} }
Controls.Label { TemplateLabel {
text: Math.round(rootItem.width / Kirigami.Units.gridUnit) + "x" + Math.round(rootItem.height / Kirigami.Units.gridUnit) text: Math.round(rootItem.width / Kirigami.Units.gridUnit) + "x" + Math.round(rootItem.height / Kirigami.Units.gridUnit)
} }
Controls.Label { TemplateLabel {
text: "Units.gridUnit:" text: "Units.gridUnit:"
} }
Controls.Label { TemplateLabel {
text: Kirigami.Units.gridUnit text: Kirigami.Units.gridUnit
} }
Controls.Label { TemplateLabel {
text: "Units.devicePixelRatio:" text: "Units.devicePixelRatio:"
} }
Controls.Label { TemplateLabel {
text: Screen.devicePixelRatio text: Screen.devicePixelRatio
} }
Kirigami.Heading { Kirigami.Heading {
text: "Font Metrics" text: "Font Metrics"
color: subsurfaceTheme.textColor
level: 3 level: 3
Layout.columnSpan: 2 Layout.columnSpan: 2
} }
Controls.Label { TemplateLabel {
text: "basePointSize:" text: "basePointSize:"
} }
Controls.Label { TemplateLabel {
text: subsurfaceTheme.basePointSize text: subsurfaceTheme.basePointSize
} }
Controls.Label { TemplateLabel {
text: "FontMetrics pointSize:" text: "FontMetrics pointSize:"
} }
Controls.Label { TemplateLabel {
text: fontMetrics.font.pointSize text: fontMetrics.font.pointSize
} }
Controls.Label { TemplateLabel {
text: "FontMetrics pixelSize:" text: "FontMetrics pixelSize:"
} }
Controls.Label { TemplateLabel {
text: Number(fontMetrics.height).toFixed(2) text: Number(fontMetrics.height).toFixed(2)
} }
Controls.Label { TemplateLabel {
text: "FontMetrics devicePixelRatio:" text: "FontMetrics devicePixelRatio:"
} }
Controls.Label { TemplateLabel {
text: Number(fontMetrics.height / fontMetrics.font.pointSize).toFixed(2) text: Number(fontMetrics.height / fontMetrics.font.pointSize).toFixed(2)
} }
Controls.Label { TemplateLabel {
text: "Text item pixelSize:" text: "Text item pixelSize:"
} }
Text { TemplateLabel {
text: fontMetrics.font.pixelSize text: fontMetrics.font.pixelSize
} }
Controls.Label { TemplateLabel {
text: "Text item pointSize:" text: "Text item pointSize:"
} }
Text { TemplateLabel {
text: fontMetrics.font.pointSize text: fontMetrics.font.pointSize
} }
Controls.Label { TemplateLabel {
text: "Pixel density:" text: "Pixel density:"
} }
Text { TemplateLabel {
text: Number(Screen.pixelDensity).toFixed(2) text: Number(Screen.pixelDensity).toFixed(2)
} }
Controls.Label { TemplateLabel {
text: "Height of default font:" text: "Height of default font:"
} }
Text { TemplateLabel {
text: Number(fontMetrics.font.pixelSize / Screen.pixelDensity).toFixed(2) + "mm" text: Number(fontMetrics.font.pixelSize / Screen.pixelDensity).toFixed(2) + "mm"
} }
Controls.Label { TemplateLabel {
text: "2cm x 2cm square:" text: "2cm x 2cm square:"
} }
Rectangle { Rectangle {
width: Math.round(Screen.pixelDensity * 20) width: Math.round(Screen.pixelDensity * 20)
height: Math.round(Screen.pixelDensity * 20) height: Math.round(Screen.pixelDensity * 20)
color: "black" color: subsurfaceTheme.textColor
} }
Controls.Label { TemplateLabel {
text: "text in 4 gridUnit square" text: "text in 4 gridUnit square"
} }
Rectangle { Rectangle {
id: backSquare id: backSquare
width: Kirigami.Units.gridUnit * 4 width: Kirigami.Units.gridUnit * 4
height: width height: width
color: subsurfaceTheme.primaryColor
border.color: subsurfaceTheme.primaryColor border.color: subsurfaceTheme.primaryColor
border.width: 1 border.width: 1
Controls.Label { Controls.Label {
anchors.top: backSquare.top anchors.top: backSquare.top
anchors.left: backSquare.left anchors.left: backSquare.left
color: subsurfaceTheme.textColor color: subsurfaceTheme.primaryTextColor
font.pointSize: subsurfaceTheme.regularPointSize font.pointSize: subsurfaceTheme.regularPointSize
text: "Simply 27 random characters" text: "Simply 27 random characters"
} }
Controls.Label { Controls.Label {
anchors.bottom: backSquare.bottom anchors.bottom: backSquare.bottom
anchors.left: backSquare.left anchors.left: backSquare.left
color: subsurfaceTheme.textColor color: subsurfaceTheme.primaryTextColor
font.pointSize: subsurfaceTheme.smallPointSize font.pointSize: subsurfaceTheme.smallPointSize
text: "Simply 27 random characters" text: "Simply 27 random characters"
} }
} }
Controls.Label { TemplateLabel {
Layout.columnSpan: 2 Layout.columnSpan: 2
Layout.fillHeight: true Layout.fillHeight: true
} }