blob: c03f89c184fc17d280f15edd0fb9253b702378ba (
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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
|
// 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 string bitmap2: ""
property bool selected: false
property alias touchBtn: myButton
property string text: ""
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
property string newFont: "../Fonts/HelveticaNeueLTStd-Roman.ttf"
property int txtSize: 24
property string txtColor: "#1d81d5"
FWdgtImage{
id: img
x:-9
y:-9
bitmap: image
}
FWdgtImage{
id: imgSelected
x:0
y:0
bitmap: imageActive
visible: false
}
FWdgtImage{
id: imgInBtn
anchors.centerIn: imgSelected
bitmap: button.bitmap
visible: false
//height: 10
//width: 10
}
BaseText {
id: btnTxt
anchors.horizontalCenter: imgSelected.horizontalCenter
anchors.verticalCenter: imgSelected.verticalCenter
//anchors.verticalCenterOffset: -1
vertAlignment: Text.AlignVCenter
horAlignment: Text.AlignHCenter
text: button.text
color: button.txtColor
visible: false
theFont: button.newFont
pxSize: button.txtSize
}
FWdgtTouchArea {
id: myButton
anchors.fill: imgSelected
}
FViewUseCaseSimple{
condition: button.text !== ""
PropertyChanges {
target: btnTxt; visible: true
}
}
FViewUseCaseSimple{
condition: button.bitmap !== ""
PropertyChanges {
target: imgInBtn; visible: true
}
}
FViewUseCaseGroup{
FViewUseCase{condition: myButton.pressed === true
PropertyChanges {
target: img; bitmap: imagePressed
}
PropertyChanges {
target: btnTxt; color: "black"
}
PropertyChanges {
target: imgInBtn; bitmap: button.bitmap2
}
}
FViewUseCase{
condition: button.active === false
PropertyChanges {
target: img; visible: false
}
PropertyChanges {
target: imgSelected; visible: true; bitmap: imageInActive
}
PropertyChanges {
target: btnTxt; color: "black"
}
PropertyChanges {
target: myButton; enabled: false
}
PropertyChanges {
target: imgInBtn; bitmap: button.bitmap2
}
}
FViewUseCase{
condition: button.selected === true
PropertyChanges {
target: img; visible: false
}
PropertyChanges {
target: imgSelected; visible: true
}
PropertyChanges {
target: btnTxt; color: "black"
}
PropertyChanges {
target: imgInBtn; bitmap: button.bitmap2
}
}
FViewUseCase{condition: myButton.pressed === false
PropertyChanges {
target: img; bitmap: image
}
PropertyChanges {
target: btnTxt; color: button.txtColor
}
PropertyChanges {
target: imgInBtn; bitmap: button.bitmap
}
}
}
}
|