2017-04-27 18:30:36 +00:00
|
|
|
// SPDX-License-Identifier: GPL-2.0
|
2015-11-06 21:53:26 +00:00
|
|
|
import QtQuick 2.5
|
|
|
|
import QtQuick.Layouts 1.1
|
2016-03-09 03:38:03 +00:00
|
|
|
import QtQuick.Window 2.2
|
2017-03-31 14:15:14 +00:00
|
|
|
import org.kde.kirigami 2.0 as Kirigami
|
2015-11-06 21:53:26 +00:00
|
|
|
|
2016-03-08 20:26:54 +00:00
|
|
|
Kirigami.Page {
|
2016-02-12 20:17:43 +00:00
|
|
|
|
2016-03-08 20:26:54 +00:00
|
|
|
title: "Theme Information"
|
2016-05-04 20:59:01 +00:00
|
|
|
|
2016-02-10 23:11:04 +00:00
|
|
|
GridLayout {
|
|
|
|
id: themetest
|
|
|
|
columns: 2
|
2016-03-08 20:26:54 +00:00
|
|
|
anchors.margins: Kirigami.Units.gridUnit / 2
|
2015-11-06 21:53:26 +00:00
|
|
|
|
2016-03-08 20:26:54 +00:00
|
|
|
Kirigami.Heading {
|
2016-02-10 23:11:04 +00:00
|
|
|
Layout.columnSpan: 2
|
2016-05-04 20:59:01 +00:00
|
|
|
text: "Theme Information"
|
2016-02-10 23:11:04 +00:00
|
|
|
}
|
2015-11-06 21:53:26 +00:00
|
|
|
|
2016-03-08 20:26:54 +00:00
|
|
|
Kirigami.Heading {
|
2016-05-04 20:59:01 +00:00
|
|
|
text: "Screen"
|
2016-02-10 23:11:04 +00:00
|
|
|
Layout.columnSpan: 2
|
|
|
|
level: 3
|
|
|
|
}
|
|
|
|
FontMetrics {
|
|
|
|
id: fm
|
|
|
|
}
|
2015-11-06 21:54:54 +00:00
|
|
|
|
2016-03-08 20:26:54 +00:00
|
|
|
Kirigami.Label {
|
2016-05-04 20:59:01 +00:00
|
|
|
text: "Geometry (pixels):"
|
2016-02-10 23:11:04 +00:00
|
|
|
}
|
2016-03-08 20:26:54 +00:00
|
|
|
Kirigami.Label {
|
2016-02-10 23:11:04 +00:00
|
|
|
text: rootItem.width + "x" + rootItem.height
|
|
|
|
}
|
2015-12-03 22:27:27 +00:00
|
|
|
|
2016-03-08 20:26:54 +00:00
|
|
|
Kirigami.Label {
|
2016-05-04 20:59:01 +00:00
|
|
|
text: "Geometry (gridUnits):"
|
2016-02-10 23:11:04 +00:00
|
|
|
}
|
2016-03-08 20:26:54 +00:00
|
|
|
Kirigami.Label {
|
|
|
|
text: Math.round(rootItem.width / Kirigami.Units.gridUnit) + "x" + Math.round(rootItem.height / Kirigami.Units.gridUnit)
|
2016-02-10 23:11:04 +00:00
|
|
|
}
|
2015-12-08 01:07:31 +00:00
|
|
|
|
2016-03-08 20:26:54 +00:00
|
|
|
Kirigami.Label {
|
2016-05-04 20:59:01 +00:00
|
|
|
text: "Units.gridUnit:"
|
2016-02-10 23:11:04 +00:00
|
|
|
}
|
2016-03-08 20:26:54 +00:00
|
|
|
Kirigami.Label {
|
|
|
|
text: Kirigami.Units.gridUnit
|
2016-02-10 23:11:04 +00:00
|
|
|
}
|
2015-11-06 21:54:54 +00:00
|
|
|
|
2016-03-08 20:26:54 +00:00
|
|
|
Kirigami.Label {
|
2016-05-04 20:59:01 +00:00
|
|
|
text: "Units.devicePixelRatio:"
|
2016-02-10 23:11:04 +00:00
|
|
|
}
|
2016-03-08 20:26:54 +00:00
|
|
|
Kirigami.Label {
|
2016-03-09 03:38:03 +00:00
|
|
|
text: Screen.devicePixelRatio
|
2016-02-10 23:11:04 +00:00
|
|
|
}
|
2015-11-06 21:54:54 +00:00
|
|
|
|
2016-03-08 20:26:54 +00:00
|
|
|
Kirigami.Heading {
|
2016-05-04 20:59:01 +00:00
|
|
|
text: "Font Metrics"
|
2016-02-10 23:11:04 +00:00
|
|
|
level: 3
|
|
|
|
Layout.columnSpan: 2
|
|
|
|
}
|
2015-12-08 01:07:31 +00:00
|
|
|
|
2016-03-08 20:26:54 +00:00
|
|
|
Kirigami.Label {
|
2016-05-04 20:59:01 +00:00
|
|
|
text: "FontMetrics pointSize:"
|
2016-02-10 23:11:04 +00:00
|
|
|
}
|
2016-03-08 20:26:54 +00:00
|
|
|
Kirigami.Label {
|
2016-02-10 23:11:04 +00:00
|
|
|
text: fm.font.pointSize
|
|
|
|
}
|
2015-11-06 21:54:54 +00:00
|
|
|
|
2016-03-08 20:26:54 +00:00
|
|
|
Kirigami.Label {
|
2016-05-04 20:59:01 +00:00
|
|
|
text: "FontMetrics pixelSize:"
|
2016-02-10 23:11:04 +00:00
|
|
|
}
|
2016-03-08 20:26:54 +00:00
|
|
|
Kirigami.Label {
|
2016-08-16 03:48:23 +00:00
|
|
|
text: Number(fm.height).toFixed(2)
|
2016-02-10 23:11:04 +00:00
|
|
|
}
|
2015-11-06 21:54:54 +00:00
|
|
|
|
2016-03-08 20:26:54 +00:00
|
|
|
Kirigami.Label {
|
2016-05-04 20:59:01 +00:00
|
|
|
text: "FontMetrics devicePixelRatio:"
|
2016-02-10 23:11:04 +00:00
|
|
|
}
|
2016-03-08 20:26:54 +00:00
|
|
|
Kirigami.Label {
|
2016-08-16 03:48:23 +00:00
|
|
|
text: Number(fm.height / fm.font.pointSize).toFixed(2)
|
2016-02-10 23:11:04 +00:00
|
|
|
}
|
2015-11-06 21:53:26 +00:00
|
|
|
|
2016-03-08 20:26:54 +00:00
|
|
|
Kirigami.Label {
|
2016-05-04 20:59:01 +00:00
|
|
|
text: "Text item pixelSize:"
|
2016-02-10 23:11:04 +00:00
|
|
|
}
|
|
|
|
Text {
|
|
|
|
text: font.pixelSize
|
|
|
|
}
|
2015-11-06 21:57:01 +00:00
|
|
|
|
2016-03-08 20:26:54 +00:00
|
|
|
Kirigami.Label {
|
2016-05-04 20:59:01 +00:00
|
|
|
text: "Text item pointSize:"
|
2016-02-10 23:11:04 +00:00
|
|
|
}
|
|
|
|
Text {
|
|
|
|
text: font.pointSize
|
|
|
|
}
|
2015-11-06 21:57:01 +00:00
|
|
|
|
2016-04-05 23:50:43 +00:00
|
|
|
Kirigami.Label {
|
2016-05-04 20:59:01 +00:00
|
|
|
text: "Pixel density:"
|
2016-04-05 23:50:43 +00:00
|
|
|
}
|
|
|
|
Text {
|
2016-08-16 03:48:23 +00:00
|
|
|
text: Number(Screen.pixelDensity).toFixed(2)
|
2016-04-05 23:50:43 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
Kirigami.Label {
|
2016-05-04 20:59:01 +00:00
|
|
|
text: "Height of default font:"
|
2016-04-05 23:50:43 +00:00
|
|
|
}
|
|
|
|
Text {
|
2016-08-16 03:48:23 +00:00
|
|
|
text: Number(font.pixelSize / Screen.pixelDensity).toFixed(2) + "mm"
|
2016-04-05 23:50:43 +00:00
|
|
|
}
|
|
|
|
|
2017-04-14 01:21:50 +00:00
|
|
|
Kirigami.Label {
|
|
|
|
text: "2cm x 2cm square:"
|
|
|
|
}
|
|
|
|
Rectangle {
|
|
|
|
width: Math.round(Screen.pixelDensity * 20)
|
|
|
|
height: Math.round(Screen.pixelDensity * 20)
|
|
|
|
color: "black"
|
|
|
|
}
|
|
|
|
|
2016-03-08 20:26:54 +00:00
|
|
|
Kirigami.Label {
|
2016-02-10 23:11:04 +00:00
|
|
|
Layout.columnSpan: 2
|
|
|
|
Layout.fillHeight: true
|
|
|
|
}
|
2015-11-06 21:53:26 +00:00
|
|
|
}
|
|
|
|
}
|