mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-24 20:18:53 +03:00
96f791daf1
See also: https://daniel.haxx.se/blog/2023/01/08/copyright-without-years/ https://hynek.me/til/copyright-years/
44 lines
1 KiB
QML
44 lines
1 KiB
QML
// SPDX-FileCopyrightText: Nheko Contributors
|
|
//
|
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
import QtQuick 2.5
|
|
import QtQuick 2.12
|
|
import QtQuick.Controls 2.12
|
|
import im.nheko 1.0
|
|
|
|
Switch {
|
|
id: toggleButton
|
|
|
|
implicitWidth: indicatorItem.width
|
|
|
|
indicator: Item {
|
|
id: indicatorItem
|
|
|
|
implicitWidth: 48
|
|
implicitHeight: 24
|
|
y: parent.height / 2 - height / 2
|
|
|
|
Rectangle {
|
|
height: 3 * parent.height / 4
|
|
radius: height / 2
|
|
width: parent.width - height
|
|
x: radius
|
|
y: parent.height / 2 - height / 2
|
|
color: toggleButton.checked ? "skyblue" : "grey"
|
|
border.color: "#cccccc"
|
|
}
|
|
|
|
Rectangle {
|
|
x: toggleButton.checked ? parent.width - width : 0
|
|
y: parent.height / 2 - height / 2
|
|
width: parent.height
|
|
height: width
|
|
radius: width / 2
|
|
color: toggleButton.enabled ? "whitesmoke" : "#cccccc"
|
|
border.color: "#ebebeb"
|
|
}
|
|
|
|
}
|
|
|
|
}
|