-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathButton.qml
50 lines (42 loc) · 916 Bytes
/
Button.qml
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
import Qt 4.7
Rectangle {
width: 150
height: 40
signal buttonClicked()
property string text
Text {
id: myText
text: parent.text
anchors.centerIn: parent
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
ColorAnimation on color {
id: uiFeedback
from: "white"
to: "black"
duration: 300
}
}
MouseArea {
id: myMouseArea
anchors.fill: parent
onClicked: {
uiFeedback.start()
parent.buttonClicked()
}
}
gradient: Gradient {
GradientStop {
position: 0
color: "#e2e2e2"
}
GradientStop {
position: 0.67
color: "#bbbbbb"
}
GradientStop {
position: 1
color: "#eeeeee"
}
}
}