2017-07-24 17:54:34 +00:00
|
|
|
// SPDX-License-Identifier: GPL-2.0
|
2017-10-29 07:44:06 +00:00
|
|
|
import QtQuick 2.6
|
2017-07-24 17:54:34 +00:00
|
|
|
import QtQuick.Controls 2.2
|
2018-09-27 20:09:26 +00:00
|
|
|
import org.kde.kirigami 2.4 as Kirigami
|
2017-07-24 17:54:34 +00:00
|
|
|
|
|
|
|
Switch {
|
|
|
|
id: root
|
|
|
|
indicator: Rectangle {
|
2018-10-21 14:55:41 +00:00
|
|
|
implicitWidth: 36 * PrefDisplay.mobile_scale
|
|
|
|
implicitHeight: 12 * PrefDisplay.mobile_scale
|
2017-07-24 17:54:34 +00:00
|
|
|
x: root.leftPadding
|
|
|
|
y: parent.height / 2 - height / 2
|
|
|
|
radius: height / 2
|
|
|
|
color: root.checked ?
|
|
|
|
subsurfaceTheme.lightPrimaryColor : subsurfaceTheme.backgroundColor
|
|
|
|
border.color: subsurfaceTheme.darkerPrimaryColor
|
|
|
|
|
|
|
|
Rectangle {
|
|
|
|
x: root.checked ? parent.width - width : 0
|
|
|
|
y: parent.height / 2 - height / 2
|
2018-10-21 14:55:41 +00:00
|
|
|
width: 20 * PrefDisplay.mobile_scale
|
|
|
|
height: 20 * PrefDisplay.mobile_scale
|
2017-07-24 17:54:34 +00:00
|
|
|
radius: height / 2
|
|
|
|
color: root.down || root.checked ?
|
|
|
|
subsurfaceTheme.primaryColor : subsurfaceTheme.lightPrimaryColor
|
|
|
|
border.color: subsurfaceTheme.darkerPrimaryColor
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|