28 lines
859 B
QML
Raw Normal View History

2019-07-30 10:57:14 +03:00
import QtQuick 2.0
import QtQuick.Window 2.12
import QtQuick.Controls.Material 2.0
import QtQuick.Controls 2.3
Item {
2019-07-31 17:47:26 +03:00
readonly property int pointCount: 100;
readonly property real mm: Screen.pixelDensity
readonly property real sm: 10 * mm
2019-07-30 10:57:14 +03:00
readonly property real dsm: Math.sqrt(Math.pow(Screen.desktopAvailableWidth, 2) + Math.pow(Screen.desktopAvailableHeight, 2)) / sm
2019-07-31 17:47:26 +03:00
readonly property real pt: getfactor(dsm) * sm
readonly property real controlPtMaterial: Material.buttonHeight
readonly property real gamePt: (width < height) ? width / pointCount : height / pointCount;
2019-07-30 10:57:14 +03:00
function getfactor(dsm) {
if (dsm < 30) {
return 0.5
} else if ( dsm < 70) {
return 1
} else if (dsm < 140) {
return 2;
} else
return 4;
}
2019-07-31 17:47:26 +03:00
anchors.fill: parent;
2019-07-30 10:57:14 +03:00
}