mirror of
https://github.com/zhuzichu520/FluentUI.git
synced 2025-07-02 08:05:29 +08:00
update
This commit is contained in:
@ -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()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user