diff options
author | jan Iversen <jan@casacondor.com> | 2020-01-15 19:46:48 +0100 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2020-01-19 11:59:04 -0800 |
commit | 5bce4895cc1fcdc4b318ddb1724333008bc32054 (patch) | |
tree | 19a782b083b970a2bf1bd0ad341dce273c5904aa /mobile-widgets | |
parent | 0443d7f2c93b33b3aa777b5b64e271c28d653702 (diff) | |
download | subsurface-5bce4895cc1fcdc4b318ddb1724333008bc32054.tar.gz |
mobile-widgets/qml: create units section and move unit_settings
Move gridlayout unit_settings to TemplateSection units, without changing
anything (apart from adding a visible: attribute).
Removed first label in units_settings, since it is the title of the section
Signed-off-by: jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'mobile-widgets')
-rw-r--r-- | mobile-widgets/qml/Settings.qml | 96 |
1 files changed, 41 insertions, 55 deletions
diff --git a/mobile-widgets/qml/Settings.qml b/mobile-widgets/qml/Settings.qml index 690c0eb1e..1e3a067b6 100644 --- a/mobile-widgets/qml/Settings.qml +++ b/mobile-widgets/qml/Settings.qml @@ -338,12 +338,48 @@ Kirigami.ScrollablePage { } } - Rectangle { - color: subsurfaceTheme.darkerPrimaryColor - height: 1 - opacity: 0.5 - Layout.fillWidth: true + TemplateSection { + 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 + } + SsrfSwitch { + id: imperialButton + checked: PrefUnits.unit_system === "imperial" + enabled: PrefUnits.unit_system === "metric" + Layout.preferredWidth: gridWidth * 0.25 + onClicked: { + PrefUnits.unit_system = "imperial" + manager.changesNeedSaving() + manager.refreshDiveList() + } + } + TemplateLabel { + text: qsTr("Use Metric Units") + Layout.preferredWidth: gridWidth * 0.75 + } + SsrfSwitch { + id: metricButtton + checked: PrefUnits.unit_system === "metric" + enabled: PrefUnits.unit_system === "imperial" + Layout.preferredWidth: gridWidth * 0.25 + onClicked: { + PrefUnits.unit_system = "metric" + manager.changesNeedSaving() + manager.refreshDiveList() + } + } + } } + GridLayout { id: gpsPrefs columns: 2 @@ -394,56 +430,6 @@ Kirigami.ScrollablePage { } GridLayout { - id: unit_system - columns: 2 - TemplateLabel { - text: qsTr("Units") - font.pointSize: subsurfaceTheme.headingPointSize - font.weight: Font.Light - Layout.topMargin: Kirigami.Units.largeSpacing - Layout.bottomMargin: Kirigami.Units.largeSpacing / 2 - Layout.columnSpan: 2 - } - - TemplateLabel { - text: qsTr("Use Imperial Units") - Layout.preferredWidth: gridWidth * 0.75 - } - SsrfSwitch { - id: imperialButton - checked: PrefUnits.unit_system === "imperial" - enabled: PrefUnits.unit_system === "metric" - Layout.preferredWidth: gridWidth * 0.25 - onClicked: { - PrefUnits.unit_system = "imperial" - manager.changesNeedSaving() - manager.refreshDiveList() - } - } - TemplateLabel { - text: qsTr("Use Metric Units") - Layout.preferredWidth: gridWidth * 0.75 - } - SsrfSwitch { - id: metricButtton - checked: PrefUnits.unit_system === "metric" - enabled: PrefUnits.unit_system === "imperial" - Layout.preferredWidth: gridWidth * 0.25 - onClicked: { - PrefUnits.unit_system = "metric" - manager.changesNeedSaving() - manager.refreshDiveList() - } - } - } - - Rectangle { - color: subsurfaceTheme.darkerPrimaryColor - height: 1 - opacity: 0.5 - Layout.fillWidth: true - } - GridLayout { id: filterPrefs columns: 2 |