mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
mobile-widgets: use radiobuttons for Units
Change to radiobuttons for units, and add a third choice (personalize). Signed-off-by: jan Iversen <jan@casacondor.com>
This commit is contained in:
parent
ef9bce9233
commit
cc5b856280
1 changed files with 16 additions and 23 deletions
|
@ -347,37 +347,30 @@ Kirigami.ScrollablePage {
|
||||||
id: sectionUnits
|
id: sectionUnits
|
||||||
title: qsTr("Units")
|
title: qsTr("Units")
|
||||||
|
|
||||||
GridLayout {
|
Row {
|
||||||
id: unit_system
|
TemplateRadioButton {
|
||||||
visible: sectionUnits.isExpanded
|
text: qsTr("Metric")
|
||||||
columns: 2
|
checked: (Backend.unit_system === Enums.METRIC)
|
||||||
|
onClicked: {
|
||||||
TemplateLabel {
|
Backend.unit_system = Enums.METRIC
|
||||||
text: qsTr("Use Imperial Units")
|
manager.changesNeedSaving()
|
||||||
Layout.preferredWidth: gridWidth * 0.75
|
manager.refreshDiveList()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
SsrfSwitch {
|
TemplateRadioButton {
|
||||||
id: imperialButton
|
text: qsTr("Imperial")
|
||||||
checked: Backend.unit_system === Enums.IMPERIAL
|
checked: (Backend.unit_system === Enums.IMPERIAL)
|
||||||
enabled: Backend.unit_system === Enums.METRIC
|
|
||||||
Layout.preferredWidth: gridWidth * 0.25
|
|
||||||
onClicked: {
|
onClicked: {
|
||||||
Backend.unit_system = Enums.IMPERIAL
|
Backend.unit_system = Enums.IMPERIAL
|
||||||
manager.changesNeedSaving()
|
manager.changesNeedSaving()
|
||||||
manager.refreshDiveList()
|
manager.refreshDiveList()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
TemplateLabel {
|
TemplateRadioButton {
|
||||||
text: qsTr("Use Metric Units")
|
text: qsTr("Personalize")
|
||||||
Layout.preferredWidth: gridWidth * 0.75
|
checked: (Backend.unit_system === Enums.PERSONALIZE)
|
||||||
}
|
|
||||||
SsrfSwitch {
|
|
||||||
id: metricButtton
|
|
||||||
checked: Backend.unit_system === Enums.METRIC
|
|
||||||
enabled: Backend.unit_system === Enums.IMPERIAL
|
|
||||||
Layout.preferredWidth: gridWidth * 0.25
|
|
||||||
onClicked: {
|
onClicked: {
|
||||||
Backend.unit_system = Enums.METRIC
|
Backend.unit_system = Enums.PERSONALIZE
|
||||||
manager.changesNeedSaving()
|
manager.changesNeedSaving()
|
||||||
manager.refreshDiveList()
|
manager.refreshDiveList()
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue