PadType.qml 3.51 KB
Newer Older
1 2 3
import QtQuick 2.6
import QtQuick.Controls 2.2
import QtQuick.Layouts 1.0
4
import App 1.0
5 6 7 8


Item
{
9
    id: root
10 11
    width: 380
    height: 300
12 13
    property real padOpacity: 1
    property alias confirmText: confirmText.text
14

15
    signal pressedButton(int keyId)
16 17 18 19 20 21 22 23 24

    Rectangle
    {
        anchors.fill: parent
        color: "#0e1531"
        radius: 40
        opacity: 0.6
    }

25 26 27 28 29 30 31 32 33 34
    Text
    {
        id: confirmText
        anchors.centerIn: parent;
        color: "#ffffff"
        text: qsTr("Payment\nAccepted")
        font.pixelSize: Variables.fontPaymentCost
        opacity: 1 - root.padOpacity;
    }

35 36 37 38 39
    Row
    {
        x: 20
        y: 20
        spacing: 10
40
        opacity: root.padOpacity;
41
        Column
42
        {
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
            spacing: 10
            PadPin
            {
                keyId: 7
                buttonText: "7"
                onPressed: pressedButton(keyId)
            }

            PadPin
            {
                keyId: 4
                buttonText: "4"
                onPressed: pressedButton(keyId)
            }

            PadPin
            {
                keyId: 1
                buttonText: "1"
                onPressed: pressedButton(keyId)
            }
64
        }
65
        Column
66
        {
67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94
            spacing: 10
            PadPin
            {
                keyId: 8
                buttonText: "8"
                onPressed: pressedButton(keyId)
            }

            PadPin
            {
                keyId: 5
                buttonText: "5"
                onPressed: pressedButton(keyId)
            }

            PadPin
            {
                keyId: 2
                buttonText: "2"
                onPressed: pressedButton(keyId)
            }

            PadPin
            {
                keyId: 0
                buttonText: "0"
                onPressed: pressedButton(keyId)
            }
95
        }
96
        Column
97
        {
98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118
            spacing: 10
            PadPin
            {
                keyId: 9
                buttonText: "9"
                onPressed: pressedButton(keyId)
            }

            PadPin
            {
                keyId: 6
                buttonText: "6"
                onPressed: pressedButton(keyId)
            }

            PadPin
            {
                keyId: 3
                buttonText: "3"
                onPressed: pressedButton(keyId)
            }
119 120
        }

121
        Column
122
        {
123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161
            spacing: 10
            PadPin
            {
                keyId: 10
                fontSize: Variables.fontKeysText
                buttonText: qsTr("Cancel")
                buttonColor: "#ce0203"
                width: 130
                onPressed: pressedButton(keyId)
            }

            PadPin
            {
                keyId: 11
                fontSize: Variables.fontKeysText
                buttonText: qsTr("Correct")
                buttonColor: "#d1a601"
                width: 130
                onPressed: pressedButton(keyId)
            }

            PadPin
            {
                keyId: 12
                fontSize: Variables.fontKeysText
                buttonText: qsTr("Help")
                buttonColor: "#0e6bcb"
                width: 130
                onPressed: pressedButton(keyId)
            }
            PadPin
            {
                keyId: 13
                fontSize: Variables.fontKeysText
                buttonText: qsTr("Enter")
                buttonColor: "#65cd52"
                width: 130
                onPressed: pressedButton(keyId)
            }
162 163 164
        }
    }
}