-
Notifications
You must be signed in to change notification settings - Fork 17
/
FlatRadioButton.qml
53 lines (46 loc) · 1.34 KB
/
FlatRadioButton.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
import QtQuick 2.3
import QtQuick.Controls 1.2
import QtQuick.Controls.Styles 1.2
RadioButton {
id: radioButton;
Constants {
id: constants;
}
text: "Default";
property string textColor: "black";
property int spacing: 12;
property bool disabled: false;
style: RadioButtonStyle {
spacing: control.spacing;
indicator: Rectangle {
height: 20;
width: 20;
radius: height * 0.5;
color: {
if (disabled) {
return "#e6e8ea";
}
else {
return control.checked ? constants.silver : constants.secondary;
}
}
Behavior on color {
PropertyAnimation {duration: 100}
}
Rectangle {
anchors.centerIn: parent;
height: parent.height * 0.6;
width: parent.height * 0.6;
radius: height * 0.5;
color: control.checked ? "white" : parent.color;
border {
width: 3;
color: "white";
}
Behavior on color {
PropertyAnimation {duration: 100}
}
}
}
}
}