QML UI: Style the radio buttons

This styles the radio  buttons in the preferences pane
so they follows the theme colors.

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
This commit is contained in:
Joakim Bygdell 2017-07-08 19:17:10 +02:00 committed by Dirk Hohndel
parent 4c4b72853c
commit 4698b86b13

View file

@ -52,10 +52,30 @@ Kirigami.Page {
}
RadioButton {
id: bluebutton
checked: subsurfaceTheme.currentTheme === "Blue"
onClicked: {
blueTheme()
}
indicator: Rectangle {
implicitWidth: 20
implicitHeight: 20
x: bluebutton.leftPadding
y: parent.height / 2 - height / 2
radius: 4
border.color: bluebutton.down ? subsurfaceTheme.PrimaryColor : subsurfaceTheme.darkerPrimaryColor
color: subsurfaceTheme.backgroundColor
Rectangle {
width: 12
height: 12
x: 4
y: 4
radius: 3
color: bluebutton.down ? subsurfaceTheme.PrimaryColor : subsurfaceTheme.darkerPrimaryColor
visible: bluebutton.checked
}
}
}
Row {
Label {
@ -98,10 +118,30 @@ Kirigami.Page {
}
RadioButton {
id: pinkbutton
checked: subsurfaceTheme.currentTheme === "Pink"
onClicked: {
pinkTheme()
}
indicator: Rectangle {
implicitWidth: 20
implicitHeight: 20
x: pinkbutton.leftPadding
y: parent.height / 2 - height / 2
radius: 4
border.color: pinkbutton.down ? subsurfaceTheme.PrimaryColor : subsurfaceTheme.darkerPrimaryColor
color: subsurfaceTheme.backgroundColor
Rectangle {
width: 12
height: 12
x: 4
y: 4
radius: 3
color: pinkbutton.down ? subsurfaceTheme.PrimaryColor : subsurfaceTheme.darkerPrimaryColor
visible: pinkbutton.checked
}
}
}
Row {
Label {
@ -144,10 +184,30 @@ Kirigami.Page {
}
RadioButton {
id: darkbutton
checked: subsurfaceTheme.currentTheme === "Dark"
onClicked: {
darkTheme()
}
indicator: Rectangle {
implicitWidth: 20
implicitHeight: 20
x: darkbutton.leftPadding
y: parent.height / 2 - height / 2
radius: 4
border.color: darkbutton.down ? subsurfaceTheme.PrimaryColor : subsurfaceTheme.darkerPrimaryColor
color: subsurfaceTheme.backgroundColor
Rectangle {
width: 12
height: 12
x: 4
y: 4
radius: 3
color: darkbutton.down ? subsurfaceTheme.PrimaryColor : subsurfaceTheme.darkerPrimaryColor
visible: darkbutton.checked
}
}
}
Row {
Label {