This commit is contained in:
zhuzihcu
2023-02-27 18:46:39 +08:00
parent 8ef76d2707
commit a772e18b93
25 changed files with 1400 additions and 62 deletions

View File

@ -4,10 +4,15 @@ import QtQuick.Controls 2.0
Switch {
id: root
property color checkedColor: "#0064B0"
signal clicked2
width: 40
implicitWidth: 40
height: 20
implicitHeight: 20
checkable: false
indicator: Rectangle {
width: 40
height: 20
width: root.width
height: root.height
radius: height / 2
color: root.checked ? checkedColor : "white"
border.width: 1
@ -21,10 +26,17 @@ Switch {
anchors.verticalCenter: parent.verticalCenter
color: root.checked ? "#FFFFFF" : "#666666"
// border.color: "#D5D5D5"
Behavior on x {
NumberAnimation { duration: 200 }
}
}
}
MouseArea{
id:switch_mouse
anchors.fill: parent
hoverEnabled: true
onClicked: {
root.clicked2()
}
}
}