aboutsummaryrefslogtreecommitdiffstats
path: root/mobile-widgets/qml/Settings.qml
diff options
context:
space:
mode:
authorGravatar jan Iversen <jan@casacondor.com>2020-01-22 18:35:20 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2020-01-24 10:55:04 -0800
commitcc5b856280d407dae1dda45f4e7475e78acb748c (patch)
treeff196d5c99f5e66209831f6cb5eca1f1ac364985 /mobile-widgets/qml/Settings.qml
parentef9bce92333323f06513905b2886dd99ff646e3e (diff)
downloadsubsurface-cc5b856280d407dae1dda45f4e7475e78acb748c.tar.gz
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>
Diffstat (limited to 'mobile-widgets/qml/Settings.qml')
-rw-r--r--mobile-widgets/qml/Settings.qml39
1 files changed, 16 insertions, 23 deletions
diff --git a/mobile-widgets/qml/Settings.qml b/mobile-widgets/qml/Settings.qml
index 139adefb4..3754656f8 100644
--- a/mobile-widgets/qml/Settings.qml
+++ b/mobile-widgets/qml/Settings.qml
@@ -347,37 +347,30 @@ Kirigami.ScrollablePage {
id: sectionUnits
title: qsTr("Units")
- GridLayout {
- id: unit_system
- visible: sectionUnits.isExpanded
- columns: 2
-
- TemplateLabel {
- text: qsTr("Use Imperial Units")
- Layout.preferredWidth: gridWidth * 0.75
+ Row {
+ TemplateRadioButton {
+ text: qsTr("Metric")
+ checked: (Backend.unit_system === Enums.METRIC)
+ onClicked: {
+ Backend.unit_system = Enums.METRIC
+ manager.changesNeedSaving()
+ manager.refreshDiveList()
+ }
}
- SsrfSwitch {
- id: imperialButton
- checked: Backend.unit_system === Enums.IMPERIAL
- enabled: Backend.unit_system === Enums.METRIC
- Layout.preferredWidth: gridWidth * 0.25
+ TemplateRadioButton {
+ text: qsTr("Imperial")
+ checked: (Backend.unit_system === Enums.IMPERIAL)
onClicked: {
Backend.unit_system = Enums.IMPERIAL
manager.changesNeedSaving()
manager.refreshDiveList()
}
}
- TemplateLabel {
- text: qsTr("Use Metric Units")
- Layout.preferredWidth: gridWidth * 0.75
- }
- SsrfSwitch {
- id: metricButtton
- checked: Backend.unit_system === Enums.METRIC
- enabled: Backend.unit_system === Enums.IMPERIAL
- Layout.preferredWidth: gridWidth * 0.25
+ TemplateRadioButton {
+ text: qsTr("Personalize")
+ checked: (Backend.unit_system === Enums.PERSONALIZE)
onClicked: {
- Backend.unit_system = Enums.METRIC
+ Backend.unit_system = Enums.PERSONALIZE
manager.changesNeedSaving()
manager.refreshDiveList()
}