Repository navigation
Expand file tree
/
Copy pathTrashButton.qml
More file actions
76 lines (67 loc) · 1.84 KB
/
Copy pathTrashButton.qml
File metadata and controls
76 lines (67 loc) · 1.84 KB
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
import QtQuick 2.15
Item {
id: root
property alias col: buttonTrash._btnColor
property alias radius: buttonTrash.radius
signal clicked
width: 50
height: 50
Rectangle {
property color _btnColor: "red"
id: buttonTrash
anchors.fill: parent
state: "normal"
Image {
source: "qrc:/qt/qml/Serenify/Images/Trash.png"
width: root.width * 0.8
fillMode: Image.PreserveAspectFit
anchors.centerIn: parent
smooth: true
MouseArea {
anchors.fill: parent
hoverEnabled: true
onEntered: {
buttonTrash.state = "hovering"
}
onExited: {
buttonTrash.state = "normal"
}
}
}
MouseArea {
anchors.fill: parent
hoverEnabled: true
onEntered: {
buttonTrash.state = "hovering"
}
onExited: {
buttonTrash.state = "normal"
}
}
states: [
State {
name: "normal"
PropertyChanges { target: buttonTrash; color: _btnColor}
},
State {
name: "hovering"
PropertyChanges { target: buttonTrash; color: Qt.lighter(_btnColor)}
}
]
transitions: [
Transition {
reversible: true
from: "normal"
to: "hovering"
ColorAnimation{
duration: 150
}
}
]
}
MouseArea{
anchors.fill: parent
cursorShape: Qt.PointingHandCursor
onClicked: root.clicked()
}
}