-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathImageButton.qml
61 lines (49 loc) · 1.16 KB
/
ImageButton.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
51
52
53
54
55
56
57
58
59
60
61
import QtQuick 2.2
import QtGraphicalEffects 1.0
Rectangle {
id: button
signal clicked
property alias iconSource: icon.source
implicitWidth: icon.implicitWidth
implicitHeight: icon.implicitHeight
//color : mouse.pressed ? "red" : "blue"
Image {
anchors.centerIn: parent
id: icon
}
GammaAdjust {
id: glow
BrightnessContrast {
id: dim
source: icon
anchors.fill: parent
brightness: -.25
}
source: dim
anchors.fill: icon
//radius: 3
gamma: 1.5
visible: false
}
MouseArea {
id: mouse
anchors.fill: parent
onClicked: button.clicked()
}
states: State {
name: "pressed"
when: mouse.pressed
/*
PropertyChanges {
target: icon
anchors.topMargin: 1
anchors.leftMargin: 1
anchors.rightMargin: -1
anchors.bottomMargin: -1
}*/
PropertyChanges {
target: glow
visible: true
}
}
}