quickshell/reusables/CustomSwitch.qml

26 lines
760 B
QML
Raw Permalink Normal View History

import QtQuick
import QtQuick.Controls.Basic
import qs
Switch {
id: control
indicator: Rectangle {
anchors.verticalCenter: parent.verticalCenter
x: control.leftPadding
y: parent.height / 2 - height / 2
2026-01-27 23:47:09 +01:00
implicitWidth: parent.implicitWidth
implicitHeight: parent.implicitHeight
radius: 26
color: Colors.surfaceContainerLow
Rectangle {
2026-01-27 23:47:09 +01:00
implicitHeight: parent.implicitHeight - 6
implicitWidth: parent.implicitWidth / 2 - 3
x: control.checked ? parent.width - width - 3 : 3
anchors.verticalCenter: parent.verticalCenter
2026-01-27 23:47:09 +01:00
radius: 24
color: control.down ? Colors.surfaceContainerHighest : Colors.primary
}
}
}