mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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:
parent
4c4b72853c
commit
4698b86b13
1 changed files with 60 additions and 0 deletions
|
@ -52,10 +52,30 @@ Kirigami.Page {
|
||||||
}
|
}
|
||||||
|
|
||||||
RadioButton {
|
RadioButton {
|
||||||
|
id: bluebutton
|
||||||
checked: subsurfaceTheme.currentTheme === "Blue"
|
checked: subsurfaceTheme.currentTheme === "Blue"
|
||||||
onClicked: {
|
onClicked: {
|
||||||
blueTheme()
|
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 {
|
Row {
|
||||||
Label {
|
Label {
|
||||||
|
@ -98,10 +118,30 @@ Kirigami.Page {
|
||||||
}
|
}
|
||||||
|
|
||||||
RadioButton {
|
RadioButton {
|
||||||
|
id: pinkbutton
|
||||||
checked: subsurfaceTheme.currentTheme === "Pink"
|
checked: subsurfaceTheme.currentTheme === "Pink"
|
||||||
onClicked: {
|
onClicked: {
|
||||||
pinkTheme()
|
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 {
|
Row {
|
||||||
Label {
|
Label {
|
||||||
|
@ -144,10 +184,30 @@ Kirigami.Page {
|
||||||
}
|
}
|
||||||
|
|
||||||
RadioButton {
|
RadioButton {
|
||||||
|
id: darkbutton
|
||||||
checked: subsurfaceTheme.currentTheme === "Dark"
|
checked: subsurfaceTheme.currentTheme === "Dark"
|
||||||
onClicked: {
|
onClicked: {
|
||||||
darkTheme()
|
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 {
|
Row {
|
||||||
Label {
|
Label {
|
||||||
|
|
Loading…
Add table
Reference in a new issue