summaryrefslogtreecommitdiffstats
path: root/demo3/horizontal/dashboard/app/TirePressure.qml
blob: 437cf2f2b1dc9cbaa71c94ea96bf29f2e9c29206 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
import QtQuick 2.6
import QtQuick.Controls 2.0

Image {
    id: root
    width: sourceSize.width
    height: sourceSize.height
    property bool mirror: false
    property alias title: title.text
    property alias pressure: pressure.text

    Label {
        id: title
        anchors.bottom: pressure.top
        font.pixelSize: 24
    }

    Label {
        id: pressure
        anchors.bottom: parent.bottom
        anchors.bottomMargin: 55
        anchors.leftMargin: 140
        anchors.rightMargin: 140
        color: '#00ADDC'
        font.pixelSize: 20
    }

    states: [
        State {
            name: 'left'
            when: !mirror
            PropertyChanges {
                target: root
                source: './images/HMI_Dashboard_LeftTire.svg'
            }
            AnchorChanges {
                target: title
                anchors.right: pressure.right
            }
            AnchorChanges {
                target: pressure
                anchors.right: parent.right
            }
        },
        State {
            name: 'right'
            when: mirror
            PropertyChanges {
                target: root
                source: './images/HMI_Dashboard_RightTire.svg'
            }
            AnchorChanges {
                target: title
                anchors.left: pressure.left
            }
            AnchorChanges {
                target: pressure
                anchors.left: parent.left
            }
        }
    ]
}