-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMCheckbox.qml
More file actions
52 lines (45 loc) · 1.36 KB
/
MCheckbox.qml
File metadata and controls
52 lines (45 loc) · 1.36 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
import QtQuick 2.7
import QtQuick.Controls 2.2
Item {
property string _text: qsTr("CheckBox")
property int _width: parent.width
property int _height: parent.height
property int _implicitWidth: 26
property int _implicitHeight: 26
property int _recWidth: 14
property int _recHeight: 14
property int _recX: 6
property int _recY: 6
CheckBox {
id: control
text: _text
checked: true
width: _width
height: _height
indicator: Rectangle {
implicitWidth: _implicitWidth
implicitHeight: _implicitHeight
x: control.leftPadding
y: parent.height / 2 - height / 2
radius: 3
border.color: control.down ? "#046380" : "#EFECCA"
Rectangle {
width: _recWidth
height: _recHeight
x: _recX
y: _recY
radius: 2
color: control.down ? "#046380" : "#EFECCA"
visible: control.checked
}
}
contentItem: Text {
text: control.text
font: control.font
opacity: enabled ? 1.0 : 0.3
color: control.down ? "#046380" : "#EFECCA"
verticalAlignment: Text.AlignVCenter
leftPadding: control.indicator.width + control.spacing
}
}
}