summaryrefslogtreecommitdiff
path: root/SDL_Core/src/components/qt_hmi/References/Look/WidgetLayouts/TouchButtonBackGroundPCALayout.qml
blob: ff6671cef686b609bd979ddcd84c3fe0d043e120 (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
63
64
65
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
95
96
97
// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
import QtQuick 2.0
import com.ford.hmiframework 1.0

import "../Widgets"

FLayout {
    id: button
    property string bitmap: ""
    property bool selected: false
    property string text: ""
    property alias touchBtn: myButton
    property string image: "climate/Button_9_9.png"
    property string imageActive: "climate/ButtonActive_0_0.png"
    property string imagePressed: "climate/ButtonPressed_9_9.png"
    property string imageInActive: "climate/ButtonInActive_0_0.png"
    property bool active: true


    FWdgtImage{
        id: img
        x:-9
        y:-9
        bitmap: "Radio/PresetBtnNotSelected_9_9.png"
    }

    FWdgtImage{
        id: imgSelected
        x:-9
        y:-9
        bitmap: "Radio/PresetBtn_9_9.png"
        visible: false
    }

    FWdgtTouchArea {
        id: myButton
        anchors.fill: img
    }

    Rectangle {
        id: btnFill
        color: "#1d81d5"
        anchors.centerIn: myButton
        height: 46
        width: 46
        radius: 23
        visible: false
    }

    BaseText {
        id: btnTxt
        anchors.centerIn: myButton
        text: button.text
        color: "#1d81d5"
    }


    FViewUseCaseSimple{
        condition: button.selected === true
        PropertyChanges {
            target: img; visible: false
        }
        PropertyChanges {
            target: imgSelected; visible: true
        }
        PropertyChanges {
            target: btnTxt; color: "white"
        }
        PropertyChanges {
            target: btnFill; color: "white"
        }
    }



    FViewUseCaseGroup{
        FViewUseCase{condition: myButton.pressed === true
            PropertyChanges {
                target: btnFill; visible: true
            }
            PropertyChanges {
                target: btnTxt; color: "black"
            }
        }
        FViewUseCase{condition: myButton.indicatorState === true
          /*  PropertyChanges {
                target: buttonArea; color: pressedColor
            }*/
        }
        FViewUseCase{condition: myButton.pressed === false
            PropertyChanges {
                target: btnFill; visible: false
            }
        }
    }

}