-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCloseButton.qml
More file actions
47 lines (40 loc) · 1.13 KB
/
CloseButton.qml
File metadata and controls
47 lines (40 loc) · 1.13 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
import QtQuick 2.10
import Qb 1.0
import Qb.Core 1.0
Rectangle{
id: objButton
signal clicked();
property color hoverBackgroundColor;
property color hoverTextColor;
property color textColor;
property color oldColor;
property color oldTextColor;
Text{
anchors.fill: parent
anchors.centerIn: parent
text: QbMF3.icon("mf-close")
verticalAlignment: Text.AlignVCenter
horizontalAlignment: Text.AlignHCenter
font.family: QbMF3.family
color: textColor;
font.pixelSize: width*0.40
}
MouseArea{
anchors.fill: parent
hoverEnabled: true
preventStealing: true
onClicked: {
objButton.clicked();
}
onEntered:{
objButton.oldColor = objButton.color;
objButton.color = objButton.hoverBackgroundColor;
objButton.oldTextColor = objButton.textColor;
objButton.textColor = objButton.hoverTextColor;
}
onExited: {
objButton.color = objButton.oldColor;
objButton.textColor = objButton.oldTextColor;
}
}
}