Mobile settings: stylize switches

Signed-off-by: Rick Walsh <rickmwalsh@gmail.com>
This commit is contained in:
Rick Walsh 2017-07-20 20:43:17 +12:00 committed by Dirk Hohndel
parent 8d2b59ff31
commit 213f68d922
2 changed files with 42 additions and 0 deletions

View file

@ -97,6 +97,27 @@ Item {
onCheckedChanged: {
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
}
}
}
}

View file

@ -379,6 +379,27 @@ Kirigami.ScrollablePage {
onClicked: {
manager.libdcLog = checked
}
indicator: Rectangle {
implicitWidth: Kirigami.Units.largeSpacing * 3
implicitHeight: Kirigami.Units.largeSpacing
x: libdclogButton.leftPadding
y: parent.height / 2 - height / 2
radius: Kirigami.Units.largeSpacing * 0.5
color: libdclogButton.checked ?
subsurfaceTheme.lightPrimaryColor : subsurfaceTheme.backgroundColor
border.color: subsurfaceTheme.darkerPrimaryColor
Rectangle {
x: libdclogButton.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: libdclogButton.down || libdclogButton.checked ?
subsurfaceTheme.primaryColor : subsurfaceTheme.lightPrimaryColor
border.color: subsurfaceTheme.darkerPrimaryColor
}
}
}
}
GridLayout {