quickshell/reusables/customSwitch.qml

25 lines
528 B
QML

import QtQuick
import QtQuick.Controls.Basic
Switch {
id: control
indicator: Rectangle {
implicitWidth: 48
implicitHeight: 26
x: control.leftPadding
y: parent.height / 2 - height / 2
radius: 13
border.color: control.checked ? "#17a81a" : "#cccccc"
Rectangle {
x: control.checked ? parent.width - width : 0
width: 26
height: 26
radius: 13
color: control.down ? "#cccccc" : "#ffffff"
}
}
}