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>
This commit is contained in:
Jocke 2018-08-20 20:02:54 +02:00 committed by Dirk Hohndel
parent 011158b25c
commit 02af3463d0
2 changed files with 46 additions and 1 deletions

View file

@ -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 }
@ -300,6 +303,41 @@ Kirigami.ScrollablePage {
}
}
Rectangle {
color: subsurfaceTheme.darkerPrimaryColor
height: 1
opacity: 0.5
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