QML UI: replace all switches with our own

As per title, helps simplify theme modifications.

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
This commit is contained in:
Joakim Bygdell 2017-07-24 20:04:47 +02:00 committed by Dirk Hohndel
parent 93ec03105e
commit 071db08b14
2 changed files with 8 additions and 133 deletions

View file

@ -96,7 +96,7 @@ Item {
text: qsTr("Show password")
Layout.preferredWidth: col1Width
}
Switch {
SsrfSwitch {
checked: false
id: showPassword
Layout.preferredWidth: col2Width
@ -105,27 +105,6 @@ Item {
password.text = "" // don't show a hidden password
password.echoMode = checked ? TextInput.Normal : TextInput.Password
}
indicator: Rectangle {
implicitWidth: Kirigami.Units.largeSpacing * 3
implicitHeight: Kirigami.Units.largeSpacing
x: showPassword.leftPadding
y: parent.height / 2 - height / 2
radius: Kirigami.Units.largeSpacing * 0.5
color: showPassword.checked ?
subsurfaceTheme.lightPrimaryColor : subsurfaceTheme.backgroundColor
border.color: subsurfaceTheme.darkerPrimaryColor
Rectangle {
x: showPassword.checked ? parent.width - width : 0
y: parent.height / 2 - height / 2
width: Kirigami.Units.largeSpacing * 1.5
height: Kirigami.Units.largeSpacing * 1.5
radius: height / 2
color: showPassword.down || showPassword.checked ?
subsurfaceTheme.primaryColor : subsurfaceTheme.lightPrimaryColor
border.color: subsurfaceTheme.darkerPrimaryColor
}
}
}
}