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

Rectangle {
    signal press
    property alias text: clickable.text
    id: container
    border.color: "#333"
    border.width: 1
    height: 45
    width: 150
    radius: 3
    gradient: Gradient {
        GradientStop {
            position: 0.0
            color: (container.focus || clickable.pressed) ?  "#3C1414" : Qt.rgba(0.18, 0.18, 0.18, 1)
        }
        GradientStop {
            position: 1.0
            color: (container.focus || clickable.pressed) ? "#9C3335" : "black"
        }
    }
    Clickable {
        anchors.fill: parent
        id: clickable
        onPress: { container.forceActiveFocus(); container.press(); }

        textAnchors.horizontalCenter: horizontalCenter
        textAnchors.verticalCenter: verticalCenter
    }
}