summaryrefslogtreecommitdiff
path: root/SDL_Core/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/GraphicalButton.qml
blob: 2e670682ee638d5c072a6361c4ab1f0797a4ee17 (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
import QtQuick 2.0

Rectangle {
    signal press
    property alias text: clickable.text
    property alias image: image.source

    id: container
    border.color: "#333"
    border.width: 1
    height: 110
    width: 150
    radius: 3
    gradient: Gradient {
        GradientStop {
            position: 0.0
            color: clickable.pressed ?  "#3C1414" : Qt.rgba(0.18, 0.18, 0.18, 1)
        }
        GradientStop {
            position: 1.0
            color: clickable.pressed ? "#9C3335" : "black"
        }
    }
    Clickable {
        anchors.fill: parent
        id: clickable
        onPress: container.press()

        textAnchors.horizontalCenter: horizontalCenter
        textAnchors.bottom: bottom
        textAnchors.bottomMargin: 10

        Image {
            id: image
            anchors.top: parent.top
            anchors.topMargin: 10
            anchors.horizontalCenter: parent.horizontalCenter
        }
    }
}