mirror of
https://github.com/QuasarApp/Snake.git
synced 2025-05-14 02:19:44 +00:00
added metrix ofr screans
This commit is contained in:
parent
9e28b7cee6
commit
de37400589
SnakeClient/SnakeApp
23
SnakeClient/SnakeApp/front-end/Metrix.qml
Normal file
23
SnakeClient/SnakeApp/front-end/Metrix.qml
Normal file
@ -0,0 +1,23 @@
|
||||
import QtQuick 2.0
|
||||
import QtQuick.Window 2.12
|
||||
import QtQuick.Controls.Material 2.0
|
||||
import QtQuick.Controls 2.3
|
||||
|
||||
Item {
|
||||
property real mm: Screen.pixelDensity
|
||||
property real sm: 10 * mm
|
||||
readonly property real dsm: Math.sqrt(Math.pow(Screen.desktopAvailableWidth, 2) + Math.pow(Screen.desktopAvailableHeight, 2)) / sm
|
||||
property real pt: getfactor(dsm) * sm
|
||||
property real controlPtMaterial: Material.buttonHeight
|
||||
|
||||
function getfactor(dsm) {
|
||||
if (dsm < 30) {
|
||||
return 0.5
|
||||
} else if ( dsm < 70) {
|
||||
return 1
|
||||
} else if (dsm < 140) {
|
||||
return 2;
|
||||
} else
|
||||
return 4;
|
||||
}
|
||||
}
|
@ -3,12 +3,11 @@ import QtQuick.Controls.Material 2.12
|
||||
import QtQuick.Controls 2.12
|
||||
import QtQuick.Layouts 1.3
|
||||
import QtGraphicalEffects 1.12
|
||||
import QtQuick.Window 2.12
|
||||
|
||||
Item {
|
||||
id: properyView
|
||||
|
||||
height: Screen.devicePixelRatio * 40
|
||||
height: 1 * metrix.pt
|
||||
|
||||
property string keyImage: "";
|
||||
property string keyText: "";
|
||||
|
@ -9,7 +9,7 @@ Frame {
|
||||
|
||||
property var model: null
|
||||
property int sourceId: 0
|
||||
width: 40 * point
|
||||
width: 5 * metrix.pt
|
||||
background: Rectangle {
|
||||
color: "#50ffffff"
|
||||
border.color: "#5e5d5d"
|
||||
|
@ -12,6 +12,7 @@ ApplicationWindow {
|
||||
readonly property int pointCount: 100;
|
||||
|
||||
property real point: (width < height) ? width/pointCount : height/pointCount;
|
||||
Metrix {id: metrix}
|
||||
|
||||
Scene {
|
||||
id: scane;
|
||||
|
@ -15,6 +15,7 @@
|
||||
<file>front-end/UserView.qml</file>
|
||||
<file>front-end/ImageView.qml</file>
|
||||
<file>front-end/PropertyView.qml</file>
|
||||
<file>front-end/Metrix.qml</file>
|
||||
</qresource>
|
||||
<qresource prefix="/texture">
|
||||
<file alias="up">img/up.svg</file>
|
||||
|
Loading…
x
Reference in New Issue
Block a user