summaryrefslogtreecommitdiffstats
path: root/mobile-widgets/qml/Settings.qml
diff options
context:
space:
mode:
authorGravatar Jocke <j.bygdell@gmail.com>2018-08-20 20:02:54 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2018-08-25 07:01:42 -0700
commit02af3463d07a05334389b2d87429f97755a2bd82 (patch)
treea2ec3714cf2f5facf31b37fd01e3b3540e555d8a /mobile-widgets/qml/Settings.qml
parent011158b25c2d3f754276d1b3326ea27aba54ac40 (diff)
downloadsubsurface-02af3463d07a05334389b2d87429f97755a2bd82.tar.gz
Mobile: add default cylinder UI
Add the UI components to let the user set the default cylinder and select the chosen cylinder when adding a new dive. Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
Diffstat (limited to 'mobile-widgets/qml/Settings.qml')
-rw-r--r--mobile-widgets/qml/Settings.qml38
1 files changed, 38 insertions, 0 deletions
diff --git a/mobile-widgets/qml/Settings.qml b/mobile-widgets/qml/Settings.qml
index d7a857f6f..45b588c93 100644
--- a/mobile-widgets/qml/Settings.qml
+++ b/mobile-widgets/qml/Settings.qml
@@ -10,6 +10,9 @@ import org.subsurfacedivelog.mobile 1.0
Kirigami.ScrollablePage {
objectName: "Settings"
id: settingsPage
+ property alias defaultCylinderModel: defaultCylinderBox.model
+ property alias defaultCylinderIndex: defaultCylinderBox.currentIndex
+
title: qsTr("Settings")
background: Rectangle { color: subsurfaceTheme.backgroundColor }
@@ -307,6 +310,41 @@ Kirigami.ScrollablePage {
Layout.fillWidth: true
}
GridLayout {
+ id: defaultCylinder
+ columns: 2
+ width: parent.width - Kirigami.Units.gridUnit
+
+ Kirigami.Heading {
+ text: qsTr("Default Cylinder")
+ color: subsurfaceTheme.textColor
+ level: 4
+ Layout.topMargin: Kirigami.Units.largeSpacing
+ Layout.bottomMargin: Kirigami.Units.largeSpacing / 2
+ Layout.columnSpan: 2
+ }
+ Controls.Label {
+ Layout.alignment: Qt.AlignRight
+ text: qsTr("Cylinder:")
+ font.pointSize: subsurfaceTheme.smallPointSize
+ }
+ Controls.ComboBox {
+ id: defaultCylinderBox
+ flat: true
+ inputMethodHints: Qt.ImhNoPredictiveText
+ Layout.fillWidth: true
+ onActivated: {
+ general.set_default_cylinder(defaultCylinderBox.currentText)
+ }
+ }
+ }
+
+ Rectangle {
+ color: subsurfaceTheme.darkerPrimaryColor
+ height: 1
+ opacity: 0.5
+ Layout.fillWidth: true
+ }
+ GridLayout {
id: developer
columns: 2
width: parent.width - Kirigami.Units.gridUnit