Commit 8c2f27c8 authored by Marco Martin's avatar Marco Martin
Browse files

heading sizes in metrics

parent 2673e2c3
......@@ -34,70 +34,111 @@ Kirigami.ScrollablePage {
anchors.margins: Kirigami.Units.gridUnit / 2
Kirigami.Heading {
text: "Screen"
id: h1
text: qsTr("Heading 1")
Layout.columnSpan: 2
level: 2
level: 1
}
QQC2.Label {
text: "Geometry (pixels):"
text: qsTr("%1 points").arg(h1.font.pointSize)
Layout.columnSpan: 2
}
Kirigami.Heading {
id: h2
text: qsTr("Heading 2")
Layout.columnSpan: 2
level: 2
}
QQC2.Label {
text: page.width + "x" + page.height
text: qsTr("%1 points").arg(h2.font.pointSize)
Layout.columnSpan: 2
}
Kirigami.Heading {
id: h3
text: qsTr("Heading 3")
Layout.columnSpan: 2
level: 3
}
QQC2.Label {
text: "Geometry (gridUnits):"
text: qsTr("%1 points").arg(h3.font.pointSize)
Layout.columnSpan: 2
}
Kirigami.Heading {
id: h4
text: qsTr("Heading 4")
Layout.columnSpan: 2
level: 4
}
QQC2.Label {
text: Math.round(page.width / Kirigami.Units.gridUnit) + "x" + Math.round(page.height / Kirigami.Units.gridUnit)
text: qsTr("%1 points").arg(h4.font.pointSize)
Layout.columnSpan: 2
}
Kirigami.Heading {
text: "Font Metrics"
level: 2
Layout.columnSpan: 2
}
QQC2.Label {
text: "Units.gridUnit:"
text: "FontMetrics pointSize:"
}
QQC2.Label {
text: Kirigami.Units.gridUnit
text: Kirigami.Units.fontMetrics.font.pointSize
}
QQC2.Label {
text: "Units.devicePixelRatio:"
text: "FontMetrics pixelSize:"
}
QQC2.Label {
text: Kirigami.Units.devicePixelRatio.toFixed(2)
text: Number(Kirigami.Units.fontMetrics.font.pixelSize).toFixed(2)
}
QQC2.Label {
text: "Screen.devicePixelRatio:"
text: "Height of default font:"
}
QQC2.Label {
text: Screen.devicePixelRatio
text: Number(font.pixelSize / Screen.pixelDensity).toFixed(2) + "mm"
}
Kirigami.Heading {
text: "Font Metrics"
level: 2
text: "Screen"
Layout.columnSpan: 2
level: 2
}
QQC2.Label {
text: "FontMetrics pointSize:"
text: "Geometry (pixels):"
}
QQC2.Label {
text: Kirigami.Units.fontMetrics.font.pointSize
text: page.width + "x" + page.height
}
QQC2.Label {
text: "FontMetrics pixelSize:"
text: "Geometry (gridUnits):"
}
QQC2.Label {
text: Number(Kirigami.Units.fontMetrics.font.pixelSize).toFixed(2)
text: Math.round(page.width / Kirigami.Units.gridUnit) + "x" + Math.round(page.height / Kirigami.Units.gridUnit)
}
QQC2.Label {
text: "Height of default font:"
text: "Units.gridUnit:"
}
QQC2.Label {
text: Number(font.pixelSize / Screen.pixelDensity).toFixed(2) + "mm"
text: Kirigami.Units.gridUnit
}
QQC2.Label {
text: "Units.devicePixelRatio:"
}
QQC2.Label {
text: Kirigami.Units.devicePixelRatio.toFixed(2)
}
QQC2.Label {
text: "Screen.devicePixelRatio:"
}
QQC2.Label {
text: Screen.devicePixelRatio
}
Kirigami.Heading {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment