2021-02-10 16:52:42 +01:00
|
|
|
import QtQuick 2.5
|
2021-02-13 19:29:42 +01:00
|
|
|
import QtQuick 2.12
|
|
|
|
import QtQuick.Controls 2.12
|
2021-02-10 16:52:42 +01:00
|
|
|
import im.nheko 1.0
|
|
|
|
|
|
|
|
Switch {
|
2021-02-13 19:29:42 +01:00
|
|
|
id: toggleButton
|
|
|
|
|
|
|
|
indicator: Item {
|
|
|
|
implicitWidth: 48
|
|
|
|
implicitHeight: 26
|
|
|
|
|
|
|
|
Rectangle {
|
|
|
|
height: parent.height/2
|
|
|
|
radius: height/2
|
|
|
|
width: parent.width - height
|
|
|
|
x: radius
|
|
|
|
y: parent.height / 2 - height / 2
|
|
|
|
color: toggleButton.checked ? "skyblue" : "grey"
|
|
|
|
border.color: "#cccccc"
|
2021-02-13 17:19:21 +01:00
|
|
|
}
|
|
|
|
|
2021-02-13 19:29:42 +01:00
|
|
|
Rectangle {
|
|
|
|
x: toggleButton.checked ? parent.width - width : 0
|
|
|
|
width: parent.height
|
|
|
|
height: width
|
|
|
|
radius: width/2
|
|
|
|
color: toggleButton.down ? "whitesmoke" : "whitesmoke"
|
|
|
|
border.color: "#999999"
|
2021-02-13 17:19:21 +01:00
|
|
|
}
|
|
|
|
}
|
2021-02-10 16:52:42 +01:00
|
|
|
}
|