mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
mobile/UI: update dive edit layout
This feels much more responsive to various screen widths to me. Instead of a fixed grid this is now a Flow that is tries to make much better use of the space available on the user's device. It's not always perfect, but to me at least a massive improvement. The commit is almost unreadable because of the re-indentation and the move of a block of fields to earlier in the form (as that made it much easier to flow everything). But with show -w you can get a better idea. We have a Flow around all the fields, we pair each label with the corresponding input field, and then have a few additional Flows to ensure that the cylinders always start in the first column. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
da42c0b104
commit
f29534e07f
2 changed files with 668 additions and 487 deletions
|
@ -3,6 +3,7 @@
|
||||||
- undo: reset dive-mode on undo of set-point addition
|
- undo: reset dive-mode on undo of set-point addition
|
||||||
- desktop: complete rewrite of the statistics code, significantly expanding capabilities
|
- desktop: complete rewrite of the statistics code, significantly expanding capabilities
|
||||||
- desktop: add preferences option to disable default cylinder types
|
- desktop: add preferences option to disable default cylinder types
|
||||||
|
- mobile: redesigned dive edit experience
|
||||||
- mobile: fix broken 'use current location' in dive edit
|
- mobile: fix broken 'use current location' in dive edit
|
||||||
- mobile: add ability to show fundamentally the same statistics as on the desktop
|
- mobile: add ability to show fundamentally the same statistics as on the desktop
|
||||||
- mobile: add settings for DC and calculated ceilings and show calculated ceilings
|
- mobile: add settings for DC and calculated ceilings and show calculated ceilings
|
||||||
|
|
|
@ -128,41 +128,113 @@ Item {
|
||||||
clearDetailsEdit()
|
clearDetailsEdit()
|
||||||
}
|
}
|
||||||
|
|
||||||
height: editArea.height
|
height: editArea.height + Kirigami.Units.gridUnit * 3
|
||||||
width: diveDetailsPage.width - diveDetailsPage.leftPadding - diveDetailsPage.rightPadding - Kirigami.Units.smallSpacing * 2
|
width: diveDetailsPage.width - diveDetailsPage.leftPadding - diveDetailsPage.rightPadding - Kirigami.Units.smallSpacing * 2
|
||||||
ColumnLayout {
|
Item {
|
||||||
|
// there is a maximum width above which this becomes less pleasant to use. 42 gridUnits
|
||||||
|
// allows for two of the large drop downs or four of the text fields or all of a cylinder
|
||||||
|
// to be in one row. More just doesn't look good
|
||||||
|
width: Math.min(parent.width - Kirigami.Units.smallSpacing, Kirigami.Units.gridUnit * 42)
|
||||||
|
// weird way to create a little space from the left edge - but I can't do a margin here
|
||||||
|
x: Kirigami.Units.smallSpacing
|
||||||
|
Flow {
|
||||||
id: editArea
|
id: editArea
|
||||||
spacing: Kirigami.Units.smallSpacing
|
// with larger fonts we need more space, or things look too crowded
|
||||||
|
spacing: subsurfaceTheme.currentScale > 1.0 ? 1.5 * Kirigami.Units.largeSpacing : Kirigami.Units.largeSpacing
|
||||||
width: parent.width
|
width: parent.width
|
||||||
|
flow: GridLayout.LeftToRight
|
||||||
GridLayout {
|
RowLayout {
|
||||||
id: editorDetails
|
|
||||||
width: parent.width
|
|
||||||
columns: 2
|
|
||||||
TemplateLabelSmall {
|
TemplateLabelSmall {
|
||||||
Layout.alignment: Qt.AlignRight
|
Layout.preferredWidth: Kirigami.Units.gridUnit * 4
|
||||||
|
horizontalAlignment: Text.AlignRight
|
||||||
|
text: qsTr("Date/Time:")
|
||||||
|
}
|
||||||
|
SsrfTextField {
|
||||||
|
id: txtDate;
|
||||||
|
Layout.preferredWidth: Kirigami.Units.gridUnit * 10
|
||||||
|
flickable: detailsEditFlickable
|
||||||
|
}
|
||||||
|
}
|
||||||
|
RowLayout {
|
||||||
|
TemplateLabelSmall {
|
||||||
|
horizontalAlignment: Text.AlignRight
|
||||||
|
Layout.preferredWidth: Kirigami.Units.gridUnit * 4
|
||||||
text: qsTr("Dive number:")
|
text: qsTr("Dive number:")
|
||||||
}
|
}
|
||||||
SsrfTextField {
|
SsrfTextField {
|
||||||
id: txtNumber;
|
id: txtNumber;
|
||||||
Layout.fillWidth: true
|
Layout.preferredWidth: Kirigami.Units.gridUnit * 3
|
||||||
|
flickable: detailsEditFlickable
|
||||||
|
}
|
||||||
|
Item {
|
||||||
|
// if date and dive number are on the same line, don't have the Depth behind them
|
||||||
|
// to ensure that we add an element that fills enough of the line that the flow
|
||||||
|
// will not pull the next element up
|
||||||
|
visible: editArea.width > Kirigami.Units.gridUnit * 27
|
||||||
|
Layout.preferredWidth: editArea.width - Kirigami.Units.gridUnit * 26
|
||||||
|
}
|
||||||
|
}
|
||||||
|
RowLayout {
|
||||||
|
TemplateLabelSmall {
|
||||||
|
Layout.preferredWidth: Kirigami.Units.gridUnit * 4
|
||||||
|
horizontalAlignment: Text.AlignRight
|
||||||
|
text: qsTr("Depth:")
|
||||||
|
}
|
||||||
|
SsrfTextField {
|
||||||
|
Layout.preferredWidth: Kirigami.Units.gridUnit * 3
|
||||||
|
id: txtDepth
|
||||||
|
validator: RegExpValidator { regExp: /[^-]*/ }
|
||||||
|
flickable: detailsEditFlickable
|
||||||
|
}
|
||||||
|
}
|
||||||
|
RowLayout {
|
||||||
|
TemplateLabelSmall {
|
||||||
|
Layout.preferredWidth: Kirigami.Units.gridUnit * 4
|
||||||
|
horizontalAlignment: Text.AlignRight
|
||||||
|
text: qsTr("Duration:")
|
||||||
|
}
|
||||||
|
SsrfTextField {
|
||||||
|
Layout.preferredWidth: Kirigami.Units.gridUnit * 3
|
||||||
|
id: txtDuration
|
||||||
|
validator: RegExpValidator { regExp: /[^-]*/ }
|
||||||
flickable: detailsEditFlickable
|
flickable: detailsEditFlickable
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
RowLayout {
|
||||||
TemplateLabelSmall {
|
TemplateLabelSmall {
|
||||||
Layout.alignment: Qt.AlignRight
|
Layout.preferredWidth: Kirigami.Units.gridUnit * 4
|
||||||
text: qsTr("Date:")
|
horizontalAlignment: Text.AlignRight
|
||||||
|
text: qsTr("Air Temp:")
|
||||||
}
|
}
|
||||||
SsrfTextField {
|
SsrfTextField {
|
||||||
id: txtDate;
|
id: txtAirTemp
|
||||||
Layout.fillWidth: true
|
Layout.preferredWidth: Kirigami.Units.gridUnit * 3
|
||||||
flickable: detailsEditFlickable
|
flickable: detailsEditFlickable
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
RowLayout {
|
||||||
TemplateLabelSmall {
|
TemplateLabelSmall {
|
||||||
Layout.alignment: Qt.AlignRight
|
Layout.preferredWidth: Kirigami.Units.gridUnit * 4
|
||||||
|
horizontalAlignment: Text.AlignRight
|
||||||
|
text: qsTr("Water Temp:")
|
||||||
|
}
|
||||||
|
SsrfTextField {
|
||||||
|
Layout.preferredWidth: Kirigami.Units.gridUnit * 3
|
||||||
|
id: txtWaterTemp
|
||||||
|
flickable: detailsEditFlickable
|
||||||
|
}
|
||||||
|
}
|
||||||
|
RowLayout {
|
||||||
|
width: Kirigami.Units.gridUnit * 20
|
||||||
|
TemplateLabelSmall {
|
||||||
|
Layout.preferredWidth: Kirigami.Units.gridUnit * 4
|
||||||
|
horizontalAlignment: Text.AlignRight
|
||||||
text: qsTr("Location:")
|
text: qsTr("Location:")
|
||||||
}
|
}
|
||||||
TemplateEditComboBox {
|
TemplateEditComboBox {
|
||||||
|
// this one needs more space
|
||||||
id: locationBox
|
id: locationBox
|
||||||
flickable: detailsEditFlickable
|
flickable: detailsEditFlickable
|
||||||
model: diveDetailsListView.currentItem && diveDetailsListView.currentItem.modelData !== null ?
|
model: diveDetailsListView.currentItem && diveDetailsListView.currentItem.modelData !== null ?
|
||||||
|
@ -176,23 +248,31 @@ Item {
|
||||||
gpsText = manager.getGpsFromSiteName(editText)
|
gpsText = manager.getGpsFromSiteName(editText)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
RowLayout {
|
||||||
|
spacing: Kirigami.Units.smallSpacing
|
||||||
|
Layout.preferredWidth: Kirigami.Units.gridUnit * 20
|
||||||
TemplateLabelSmall {
|
TemplateLabelSmall {
|
||||||
Layout.alignment: Qt.AlignRight
|
Layout.preferredWidth: Kirigami.Units.gridUnit * 4
|
||||||
|
horizontalAlignment: Text.AlignRight
|
||||||
text: qsTr("Coordinates:")
|
text: qsTr("Coordinates:")
|
||||||
}
|
}
|
||||||
SsrfTextField {
|
SsrfTextField {
|
||||||
|
Layout.preferredWidth: Kirigami.Units.gridUnit * 16
|
||||||
id: txtGps
|
id: txtGps
|
||||||
Layout.fillWidth: true
|
|
||||||
flickable: detailsEditFlickable
|
flickable: detailsEditFlickable
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
RowLayout {
|
||||||
|
width: manager.locationServiceAvailable ? Kirigami.Units.gridUnit * 12 : 0
|
||||||
TemplateLabelSmall {
|
TemplateLabelSmall {
|
||||||
Layout.alignment: Qt.AlignRight
|
Layout.preferredWidth: Kirigami.Units.gridUnit * 6
|
||||||
|
horizontalAlignment: Text.AlignRight
|
||||||
text: qsTr("Use current\nGPS location:")
|
text: qsTr("Use current\nGPS location:")
|
||||||
visible: manager.locationServiceAvailable
|
visible: manager.locationServiceAvailable
|
||||||
}
|
}
|
||||||
TemplateCheckBox {
|
TemplateCheckBox {
|
||||||
|
Layout.preferredWidth: Kirigami.Units.gridUnit * 6
|
||||||
id: checkboxGPS
|
id: checkboxGPS
|
||||||
visible: manager.locationServiceAvailable
|
visible: manager.locationServiceAvailable
|
||||||
onCheckedChanged: {
|
onCheckedChanged: {
|
||||||
|
@ -200,6 +280,8 @@ Item {
|
||||||
gpsText = manager.getCurrentPosition()
|
gpsText = manager.getCurrentPosition()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
target: manager
|
target: manager
|
||||||
onWaitingForPositionChanged: {
|
onWaitingForPositionChanged: {
|
||||||
|
@ -207,50 +289,11 @@ Item {
|
||||||
manager.appendTextToLog("received updated position info " + gpsText)
|
manager.appendTextToLog("received updated position info " + gpsText)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
RowLayout {
|
||||||
|
width: Kirigami.Units.gridUnit * 20
|
||||||
TemplateLabelSmall {
|
TemplateLabelSmall {
|
||||||
Layout.alignment: Qt.AlignRight
|
Layout.preferredWidth: Kirigami.Units.gridUnit * 4
|
||||||
text: qsTr("Depth:")
|
horizontalAlignment: Text.AlignRight
|
||||||
}
|
|
||||||
SsrfTextField {
|
|
||||||
id: txtDepth
|
|
||||||
Layout.fillWidth: true
|
|
||||||
validator: RegExpValidator { regExp: /[^-]*/ }
|
|
||||||
flickable: detailsEditFlickable
|
|
||||||
}
|
|
||||||
TemplateLabelSmall {
|
|
||||||
Layout.alignment: Qt.AlignRight
|
|
||||||
text: qsTr("Duration:")
|
|
||||||
}
|
|
||||||
SsrfTextField {
|
|
||||||
id: txtDuration
|
|
||||||
Layout.fillWidth: true
|
|
||||||
validator: RegExpValidator { regExp: /[^-]*/ }
|
|
||||||
flickable: detailsEditFlickable
|
|
||||||
}
|
|
||||||
|
|
||||||
TemplateLabelSmall {
|
|
||||||
Layout.alignment: Qt.AlignRight
|
|
||||||
text: qsTr("Air Temp:")
|
|
||||||
}
|
|
||||||
SsrfTextField {
|
|
||||||
id: txtAirTemp
|
|
||||||
Layout.fillWidth: true
|
|
||||||
flickable: detailsEditFlickable
|
|
||||||
}
|
|
||||||
|
|
||||||
TemplateLabelSmall {
|
|
||||||
Layout.alignment: Qt.AlignRight
|
|
||||||
text: qsTr("Water Temp:")
|
|
||||||
}
|
|
||||||
SsrfTextField {
|
|
||||||
id: txtWaterTemp
|
|
||||||
Layout.fillWidth: true
|
|
||||||
flickable: detailsEditFlickable
|
|
||||||
}
|
|
||||||
|
|
||||||
TemplateLabelSmall {
|
|
||||||
Layout.alignment: Qt.AlignRight
|
|
||||||
text: qsTr("Suit:")
|
text: qsTr("Suit:")
|
||||||
}
|
}
|
||||||
TemplateEditComboBox {
|
TemplateEditComboBox {
|
||||||
|
@ -259,9 +302,12 @@ Item {
|
||||||
model: diveDetailsListView.currentItem && diveDetailsListView.currentItem.modelData !== null ?
|
model: diveDetailsListView.currentItem && diveDetailsListView.currentItem.modelData !== null ?
|
||||||
manager.suitList : null
|
manager.suitList : null
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
RowLayout {
|
||||||
|
width: Kirigami.Units.gridUnit * 20
|
||||||
TemplateLabelSmall {
|
TemplateLabelSmall {
|
||||||
Layout.alignment: Qt.AlignRight
|
Layout.preferredWidth: Kirigami.Units.gridUnit * 4
|
||||||
|
horizontalAlignment: Text.AlignRight
|
||||||
text: qsTr("Buddy:")
|
text: qsTr("Buddy:")
|
||||||
}
|
}
|
||||||
TemplateEditComboBox {
|
TemplateEditComboBox {
|
||||||
|
@ -270,9 +316,12 @@ Item {
|
||||||
model: diveDetailsListView.currentItem && diveDetailsListView.currentItem.modelData !== null ?
|
model: diveDetailsListView.currentItem && diveDetailsListView.currentItem.modelData !== null ?
|
||||||
manager.buddyList : null
|
manager.buddyList : null
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
RowLayout {
|
||||||
|
width: Kirigami.Units.gridUnit * 20
|
||||||
TemplateLabelSmall {
|
TemplateLabelSmall {
|
||||||
Layout.alignment: Qt.AlignRight
|
Layout.preferredWidth: Kirigami.Units.gridUnit * 4
|
||||||
|
horizontalAlignment: Text.AlignRight
|
||||||
text: qsTr("Divemaster:")
|
text: qsTr("Divemaster:")
|
||||||
}
|
}
|
||||||
TemplateEditComboBox {
|
TemplateEditComboBox {
|
||||||
|
@ -281,21 +330,37 @@ Item {
|
||||||
model: diveDetailsListView.currentItem && diveDetailsListView.currentItem.modelData !== null ?
|
model: diveDetailsListView.currentItem && diveDetailsListView.currentItem.modelData !== null ?
|
||||||
manager.divemasterList : null
|
manager.divemasterList : null
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
RowLayout {
|
||||||
|
width: Kirigami.Units.gridUnit * 16
|
||||||
TemplateLabelSmall {
|
TemplateLabelSmall {
|
||||||
Layout.alignment: Qt.AlignRight
|
Layout.preferredWidth: Kirigami.Units.gridUnit * 4
|
||||||
|
horizontalAlignment: Text.AlignRight
|
||||||
text: qsTr("Weight:")
|
text: qsTr("Weight:")
|
||||||
}
|
}
|
||||||
SsrfTextField {
|
SsrfTextField {
|
||||||
id: txtWeight
|
id: txtWeight
|
||||||
|
Layout.preferredWidth: Kirigami.Units.gridUnit * 12
|
||||||
readOnly: text === "cannot edit multiple weight systems"
|
readOnly: text === "cannot edit multiple weight systems"
|
||||||
Layout.fillWidth: true
|
|
||||||
flickable: detailsEditFlickable
|
flickable: detailsEditFlickable
|
||||||
}
|
}
|
||||||
// all cylinder info should be able to become dynamic instead of this blob of code.
|
}
|
||||||
// first cylinder
|
|
||||||
|
// all cylinder info should be able to become dynamic instead of this blob of code.
|
||||||
|
// first cylinder
|
||||||
|
Flow {
|
||||||
|
width: parent.width
|
||||||
|
|
||||||
|
|
||||||
|
RowLayout {
|
||||||
|
width: Kirigami.Units.gridUnit * 12
|
||||||
|
id: cb1
|
||||||
|
|
||||||
TemplateLabelSmall {
|
TemplateLabelSmall {
|
||||||
Layout.alignment: Qt.AlignRight
|
Layout.preferredWidth: Kirigami.Units.gridUnit * 4
|
||||||
|
horizontalAlignment: Text.AlignRight
|
||||||
text: qsTr("Cylinder1:")
|
text: qsTr("Cylinder1:")
|
||||||
}
|
}
|
||||||
TemplateComboBox {
|
TemplateComboBox {
|
||||||
|
@ -305,11 +370,14 @@ Item {
|
||||||
model: diveDetailsListView.currentItem && diveDetailsListView.currentItem.modelData !== null ?
|
model: diveDetailsListView.currentItem && diveDetailsListView.currentItem.modelData !== null ?
|
||||||
diveDetailsListView.currentItem.modelData.cylinderList : null
|
diveDetailsListView.currentItem.modelData.cylinderList : null
|
||||||
inputMethodHints: Qt.ImhNoPredictiveText
|
inputMethodHints: Qt.ImhNoPredictiveText
|
||||||
Layout.fillWidth: true
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
RowLayout {
|
||||||
|
height: cb1.height
|
||||||
|
width: Kirigami.Units.gridUnit * 8
|
||||||
TemplateLabelSmall {
|
TemplateLabelSmall {
|
||||||
Layout.alignment: Qt.AlignRight
|
Layout.preferredWidth: Kirigami.Units.gridUnit * 4
|
||||||
|
horizontalAlignment: Text.AlignRight
|
||||||
text: qsTr("Gas mix:")
|
text: qsTr("Gas mix:")
|
||||||
}
|
}
|
||||||
SsrfTextField {
|
SsrfTextField {
|
||||||
|
@ -319,9 +387,13 @@ Item {
|
||||||
validator: RegExpValidator { regExp: /(EAN100|EAN\d\d|AIR|100|\d{1,2}|\d{1,2}\/\d{1,2})/i }
|
validator: RegExpValidator { regExp: /(EAN100|EAN\d\d|AIR|100|\d{1,2}|\d{1,2}\/\d{1,2})/i }
|
||||||
flickable: detailsEditFlickable
|
flickable: detailsEditFlickable
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
RowLayout {
|
||||||
|
height: cb1.height
|
||||||
|
width: Kirigami.Units.gridUnit * 10
|
||||||
TemplateLabelSmall {
|
TemplateLabelSmall {
|
||||||
Layout.alignment: Qt.AlignRight
|
Layout.preferredWidth: Kirigami.Units.gridUnit * 6
|
||||||
|
horizontalAlignment: Text.AlignRight
|
||||||
text: qsTr("Start Pressure:")
|
text: qsTr("Start Pressure:")
|
||||||
}
|
}
|
||||||
SsrfTextField {
|
SsrfTextField {
|
||||||
|
@ -330,9 +402,13 @@ Item {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
flickable: detailsEditFlickable
|
flickable: detailsEditFlickable
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
RowLayout {
|
||||||
|
height: cb1.height
|
||||||
|
width: Kirigami.Units.gridUnit * 10
|
||||||
TemplateLabelSmall {
|
TemplateLabelSmall {
|
||||||
Layout.alignment: Qt.AlignRight
|
Layout.preferredWidth: Kirigami.Units.gridUnit * 6
|
||||||
|
horizontalAlignment: Text.AlignRight
|
||||||
text: qsTr("End Pressure:")
|
text: qsTr("End Pressure:")
|
||||||
}
|
}
|
||||||
SsrfTextField {
|
SsrfTextField {
|
||||||
|
@ -341,10 +417,19 @@ Item {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
flickable: detailsEditFlickable
|
flickable: detailsEditFlickable
|
||||||
}
|
}
|
||||||
//second cylinder
|
}
|
||||||
|
}
|
||||||
|
//second cylinder
|
||||||
|
Flow {
|
||||||
|
width: parent.width
|
||||||
|
|
||||||
|
RowLayout {
|
||||||
|
id: cb2
|
||||||
|
width: Kirigami.Units.gridUnit * 12
|
||||||
TemplateLabelSmall {
|
TemplateLabelSmall {
|
||||||
|
Layout.preferredWidth: Kirigami.Units.gridUnit * 4
|
||||||
visible: usedCyl[1] != null ? true : false
|
visible: usedCyl[1] != null ? true : false
|
||||||
Layout.alignment: Qt.AlignRight
|
horizontalAlignment: Text.AlignRight
|
||||||
text: qsTr("Cylinder2:")
|
text: qsTr("Cylinder2:")
|
||||||
}
|
}
|
||||||
TemplateComboBox {
|
TemplateComboBox {
|
||||||
|
@ -355,12 +440,15 @@ Item {
|
||||||
model: diveDetailsListView.currentItem && diveDetailsListView.currentItem.modelData !== null ?
|
model: diveDetailsListView.currentItem && diveDetailsListView.currentItem.modelData !== null ?
|
||||||
diveDetailsListView.currentItem.modelData.cylinderList : null
|
diveDetailsListView.currentItem.modelData.cylinderList : null
|
||||||
inputMethodHints: Qt.ImhNoPredictiveText
|
inputMethodHints: Qt.ImhNoPredictiveText
|
||||||
Layout.fillWidth: true
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
RowLayout {
|
||||||
|
width: Kirigami.Units.gridUnit * 8
|
||||||
|
height: cb2.height
|
||||||
TemplateLabelSmall {
|
TemplateLabelSmall {
|
||||||
visible: usedCyl[1] != null ? true : false
|
visible: usedCyl[1] != null ? true : false
|
||||||
Layout.alignment: Qt.AlignRight
|
Layout.preferredWidth: Kirigami.Units.gridUnit * 4
|
||||||
|
horizontalAlignment: Text.AlignRight
|
||||||
text: qsTr("Gas mix:")
|
text: qsTr("Gas mix:")
|
||||||
}
|
}
|
||||||
SsrfTextField {
|
SsrfTextField {
|
||||||
|
@ -371,10 +459,14 @@ Item {
|
||||||
validator: RegExpValidator { regExp: /(EAN100|EAN\d\d|AIR|100|\d{1,2}|\d{1,2}\/\d{1,2})/i }
|
validator: RegExpValidator { regExp: /(EAN100|EAN\d\d|AIR|100|\d{1,2}|\d{1,2}\/\d{1,2})/i }
|
||||||
flickable: detailsEditFlickable
|
flickable: detailsEditFlickable
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
RowLayout {
|
||||||
|
width: Kirigami.Units.gridUnit * 10
|
||||||
|
height: cb2.height
|
||||||
TemplateLabelSmall {
|
TemplateLabelSmall {
|
||||||
visible: usedCyl[1] != null ? true : false
|
visible: usedCyl[1] != null ? true : false
|
||||||
Layout.alignment: Qt.AlignRight
|
Layout.preferredWidth: Kirigami.Units.gridUnit * 6
|
||||||
|
horizontalAlignment: Text.AlignRight
|
||||||
text: qsTr("Start Pressure:")
|
text: qsTr("Start Pressure:")
|
||||||
}
|
}
|
||||||
SsrfTextField {
|
SsrfTextField {
|
||||||
|
@ -384,10 +476,14 @@ Item {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
flickable: detailsEditFlickable
|
flickable: detailsEditFlickable
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
RowLayout {
|
||||||
|
width: Kirigami.Units.gridUnit * 10
|
||||||
|
height: cb2.height
|
||||||
TemplateLabelSmall {
|
TemplateLabelSmall {
|
||||||
visible: usedCyl[1] != null ? true : false
|
visible: usedCyl[1] != null ? true : false
|
||||||
Layout.alignment: Qt.AlignRight
|
Layout.preferredWidth: Kirigami.Units.gridUnit * 6
|
||||||
|
horizontalAlignment: Text.AlignRight
|
||||||
text: qsTr("End Pressure:")
|
text: qsTr("End Pressure:")
|
||||||
}
|
}
|
||||||
SsrfTextField {
|
SsrfTextField {
|
||||||
|
@ -397,10 +493,18 @@ Item {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
flickable: detailsEditFlickable
|
flickable: detailsEditFlickable
|
||||||
}
|
}
|
||||||
// third cylinder
|
}
|
||||||
|
}
|
||||||
|
// third cylinder
|
||||||
|
Flow {
|
||||||
|
width: parent.width
|
||||||
|
RowLayout {
|
||||||
|
id: cb3
|
||||||
|
width: Kirigami.Units.gridUnit * 12
|
||||||
TemplateLabelSmall {
|
TemplateLabelSmall {
|
||||||
|
Layout.preferredWidth: Kirigami.Units.gridUnit * 4
|
||||||
visible: usedCyl[2] != null ? true : false
|
visible: usedCyl[2] != null ? true : false
|
||||||
Layout.alignment: Qt.AlignRight
|
horizontalAlignment: Text.AlignRight
|
||||||
text: qsTr("Cylinder3:")
|
text: qsTr("Cylinder3:")
|
||||||
}
|
}
|
||||||
TemplateComboBox {
|
TemplateComboBox {
|
||||||
|
@ -412,12 +516,15 @@ Item {
|
||||||
model: diveDetailsListView.currentItem && diveDetailsListView.currentItem.modelData !== null ?
|
model: diveDetailsListView.currentItem && diveDetailsListView.currentItem.modelData !== null ?
|
||||||
diveDetailsListView.currentItem.modelData.cylinderList : null
|
diveDetailsListView.currentItem.modelData.cylinderList : null
|
||||||
inputMethodHints: Qt.ImhNoPredictiveText
|
inputMethodHints: Qt.ImhNoPredictiveText
|
||||||
Layout.fillWidth: true
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
RowLayout {
|
||||||
|
width: Kirigami.Units.gridUnit * 8
|
||||||
|
height: cb3.height
|
||||||
TemplateLabelSmall {
|
TemplateLabelSmall {
|
||||||
visible: usedCyl[2] != null ? true : false
|
visible: usedCyl[2] != null ? true : false
|
||||||
Layout.alignment: Qt.AlignRight
|
Layout.preferredWidth: Kirigami.Units.gridUnit * 4
|
||||||
|
horizontalAlignment: Text.AlignRight
|
||||||
text: qsTr("Gas mix:")
|
text: qsTr("Gas mix:")
|
||||||
}
|
}
|
||||||
SsrfTextField {
|
SsrfTextField {
|
||||||
|
@ -426,11 +533,16 @@ Item {
|
||||||
text: usedGas[2] != null ? usedGas[2] : null
|
text: usedGas[2] != null ? usedGas[2] : null
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
validator: RegExpValidator { regExp: /(EAN100|EAN\d\d|AIR|100|\d{1,2}|\d{1,2}\/\d{1,2})/i }
|
validator: RegExpValidator { regExp: /(EAN100|EAN\d\d|AIR|100|\d{1,2}|\d{1,2}\/\d{1,2})/i }
|
||||||
|
flickable: detailsEditFlickable
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
RowLayout {
|
||||||
|
width: Kirigami.Units.gridUnit * 10
|
||||||
|
height: cb3.height
|
||||||
TemplateLabelSmall {
|
TemplateLabelSmall {
|
||||||
visible: usedCyl[2] != null ? true : false
|
visible: usedCyl[2] != null ? true : false
|
||||||
Layout.alignment: Qt.AlignRight
|
Layout.preferredWidth: Kirigami.Units.gridUnit * 6
|
||||||
|
horizontalAlignment: Text.AlignRight
|
||||||
text: qsTr("Start Pressure:")
|
text: qsTr("Start Pressure:")
|
||||||
}
|
}
|
||||||
SsrfTextField {
|
SsrfTextField {
|
||||||
|
@ -440,10 +552,14 @@ Item {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
flickable: detailsEditFlickable
|
flickable: detailsEditFlickable
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
RowLayout {
|
||||||
|
width: Kirigami.Units.gridUnit * 10
|
||||||
|
height: cb3.height
|
||||||
TemplateLabelSmall {
|
TemplateLabelSmall {
|
||||||
visible: usedCyl[2] != null ? true : false
|
visible: usedCyl[2] != null ? true : false
|
||||||
Layout.alignment: Qt.AlignRight
|
Layout.preferredWidth: Kirigami.Units.gridUnit * 6
|
||||||
|
horizontalAlignment: Text.AlignRight
|
||||||
text: qsTr("End Pressure:")
|
text: qsTr("End Pressure:")
|
||||||
}
|
}
|
||||||
SsrfTextField {
|
SsrfTextField {
|
||||||
|
@ -453,10 +569,18 @@ Item {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
flickable: detailsEditFlickable
|
flickable: detailsEditFlickable
|
||||||
}
|
}
|
||||||
// fourth cylinder
|
}
|
||||||
|
}
|
||||||
|
// fourth cylinder
|
||||||
|
Flow {
|
||||||
|
width: parent.width
|
||||||
|
RowLayout {
|
||||||
|
id: cb4
|
||||||
|
width: Kirigami.Units.gridUnit * 12
|
||||||
TemplateLabelSmall {
|
TemplateLabelSmall {
|
||||||
visible: usedCyl[3] != null ? true : false
|
visible: usedCyl[3] != null ? true : false
|
||||||
Layout.alignment: Qt.AlignRight
|
Layout.preferredWidth: Kirigami.Units.gridUnit * 4
|
||||||
|
horizontalAlignment: Text.AlignRight
|
||||||
text: qsTr("Cylinder4:")
|
text: qsTr("Cylinder4:")
|
||||||
}
|
}
|
||||||
TemplateComboBox {
|
TemplateComboBox {
|
||||||
|
@ -468,12 +592,16 @@ Item {
|
||||||
model: diveDetailsListView.currentItem && diveDetailsListView.currentItem.modelData !== null ?
|
model: diveDetailsListView.currentItem && diveDetailsListView.currentItem.modelData !== null ?
|
||||||
diveDetailsListView.currentItem.modelData.cylinderList : null
|
diveDetailsListView.currentItem.modelData.cylinderList : null
|
||||||
inputMethodHints: Qt.ImhNoPredictiveText
|
inputMethodHints: Qt.ImhNoPredictiveText
|
||||||
Layout.fillWidth: true
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
RowLayout {
|
||||||
|
width: Kirigami.Units.gridUnit * 8
|
||||||
|
height: cb4.height
|
||||||
TemplateLabelSmall {
|
TemplateLabelSmall {
|
||||||
visible: usedCyl[3] != null ? true : false
|
visible: usedCyl[3] != null ? true : false
|
||||||
Layout.alignment: Qt.AlignRight
|
Layout.preferredWidth: Kirigami.Units.gridUnit * 4
|
||||||
|
horizontalAlignment: Text.AlignRight
|
||||||
text: qsTr("Gas mix:")
|
text: qsTr("Gas mix:")
|
||||||
}
|
}
|
||||||
SsrfTextField {
|
SsrfTextField {
|
||||||
|
@ -485,9 +613,14 @@ Item {
|
||||||
flickable: detailsEditFlickable
|
flickable: detailsEditFlickable
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
RowLayout {
|
||||||
|
width: Kirigami.Units.gridUnit * 10
|
||||||
|
height: cb4.height
|
||||||
TemplateLabelSmall {
|
TemplateLabelSmall {
|
||||||
visible: usedCyl[3] != null ? true : false
|
visible: usedCyl[3] != null ? true : false
|
||||||
Layout.alignment: Qt.AlignRight
|
Layout.preferredWidth: Kirigami.Units.gridUnit * 6
|
||||||
|
horizontalAlignment: Text.AlignRight
|
||||||
text: qsTr("Start Pressure:")
|
text: qsTr("Start Pressure:")
|
||||||
}
|
}
|
||||||
SsrfTextField {
|
SsrfTextField {
|
||||||
|
@ -498,9 +631,14 @@ Item {
|
||||||
flickable: detailsEditFlickable
|
flickable: detailsEditFlickable
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
RowLayout {
|
||||||
|
width: Kirigami.Units.gridUnit * 10
|
||||||
|
height: cb4.height
|
||||||
TemplateLabelSmall {
|
TemplateLabelSmall {
|
||||||
visible: usedCyl[3] != null ? true : false
|
visible: usedCyl[3] != null ? true : false
|
||||||
Layout.alignment: Qt.AlignRight
|
Layout.preferredWidth: Kirigami.Units.gridUnit * 6
|
||||||
|
horizontalAlignment: Text.AlignRight
|
||||||
text: qsTr("End Pressure:")
|
text: qsTr("End Pressure:")
|
||||||
}
|
}
|
||||||
SsrfTextField {
|
SsrfTextField {
|
||||||
|
@ -510,10 +648,18 @@ Item {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
flickable: detailsEditFlickable
|
flickable: detailsEditFlickable
|
||||||
}
|
}
|
||||||
// fifth cylinder
|
}
|
||||||
|
}
|
||||||
|
// fifth cylinder
|
||||||
|
Flow {
|
||||||
|
width: parent.width
|
||||||
|
RowLayout {
|
||||||
|
id: cb5
|
||||||
|
width: Kirigami.Units.gridUnit * 12
|
||||||
TemplateLabelSmall {
|
TemplateLabelSmall {
|
||||||
visible: usedCyl[4] != null ? true : false
|
visible: usedCyl[4] != null ? true : false
|
||||||
Layout.alignment: Qt.AlignRight
|
Layout.preferredWidth: Kirigami.Units.gridUnit * 4
|
||||||
|
horizontalAlignment: Text.AlignRight
|
||||||
text: qsTr("Cylinder5:")
|
text: qsTr("Cylinder5:")
|
||||||
}
|
}
|
||||||
TemplateComboBox {
|
TemplateComboBox {
|
||||||
|
@ -528,9 +674,14 @@ Item {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
RowLayout {
|
||||||
|
width: Kirigami.Units.gridUnit * 8
|
||||||
|
height: cb5.height
|
||||||
TemplateLabelSmall {
|
TemplateLabelSmall {
|
||||||
visible: usedCyl[4] != null ? true : false
|
visible: usedCyl[4] != null ? true : false
|
||||||
Layout.alignment: Qt.AlignRight
|
Layout.preferredWidth: Kirigami.Units.gridUnit * 4
|
||||||
|
horizontalAlignment: Text.AlignRight
|
||||||
text: qsTr("Gas mix:")
|
text: qsTr("Gas mix:")
|
||||||
}
|
}
|
||||||
SsrfTextField {
|
SsrfTextField {
|
||||||
|
@ -542,9 +693,14 @@ Item {
|
||||||
flickable: detailsEditFlickable
|
flickable: detailsEditFlickable
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
RowLayout {
|
||||||
|
width: Kirigami.Units.gridUnit * 10
|
||||||
|
height: cb5.height
|
||||||
TemplateLabelSmall {
|
TemplateLabelSmall {
|
||||||
visible: usedCyl[4] != null ? true : false
|
visible: usedCyl[4] != null ? true : false
|
||||||
Layout.alignment: Qt.AlignRight
|
Layout.preferredWidth: Kirigami.Units.gridUnit * 6
|
||||||
|
horizontalAlignment: Text.AlignRight
|
||||||
text: qsTr("Start Pressure:")
|
text: qsTr("Start Pressure:")
|
||||||
}
|
}
|
||||||
SsrfTextField {
|
SsrfTextField {
|
||||||
|
@ -555,9 +711,14 @@ Item {
|
||||||
flickable: detailsEditFlickable
|
flickable: detailsEditFlickable
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
RowLayout {
|
||||||
|
width: Kirigami.Units.gridUnit * 10
|
||||||
|
height: cb5.height
|
||||||
TemplateLabelSmall {
|
TemplateLabelSmall {
|
||||||
visible: usedCyl[4] != null ? true : false
|
visible: usedCyl[4] != null ? true : false
|
||||||
Layout.alignment: Qt.AlignRight
|
Layout.preferredWidth: Kirigami.Units.gridUnit * 6
|
||||||
|
horizontalAlignment: Text.AlignRight
|
||||||
text: qsTr("End Pressure:")
|
text: qsTr("End Pressure:")
|
||||||
}
|
}
|
||||||
SsrfTextField {
|
SsrfTextField {
|
||||||
|
@ -567,38 +728,55 @@ Item {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
flickable: detailsEditFlickable
|
flickable: detailsEditFlickable
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// rating / visibility
|
||||||
|
RowLayout {
|
||||||
|
width: parent.width
|
||||||
|
|
||||||
|
RowLayout {
|
||||||
|
width: Kirigami.Units.gridUnit * 10
|
||||||
TemplateLabelSmall {
|
TemplateLabelSmall {
|
||||||
Layout.alignment: Qt.AlignRight
|
Layout.preferredWidth: Kirigami.Units.gridUnit * 4
|
||||||
|
horizontalAlignment: Text.AlignRight
|
||||||
text: qsTr("Rating:")
|
text: qsTr("Rating:")
|
||||||
}
|
}
|
||||||
TemplateSpinBox {
|
TemplateSpinBox {
|
||||||
id: ratingPicker
|
id: ratingPicker
|
||||||
|
Layout.preferredWidth: Kirigami.Units.gridUnit * 6
|
||||||
from: 0
|
from: 0
|
||||||
to: 5
|
to: 5
|
||||||
value: rating
|
value: rating
|
||||||
onValueChanged: rating = value
|
onValueChanged: rating = value
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
RowLayout {
|
||||||
|
width: Kirigami.Units.gridUnit * 10
|
||||||
TemplateLabelSmall {
|
TemplateLabelSmall {
|
||||||
Layout.alignment: Qt.AlignRight
|
Layout.preferredWidth: Kirigami.Units.gridUnit * 4
|
||||||
|
horizontalAlignment: Text.AlignRight
|
||||||
text: qsTr("Visibility:")
|
text: qsTr("Visibility:")
|
||||||
}
|
}
|
||||||
TemplateSpinBox {
|
TemplateSpinBox {
|
||||||
id: visibilityPicker
|
id: visibilityPicker
|
||||||
|
Layout.preferredWidth: Kirigami.Units.gridUnit * 6
|
||||||
from: 0
|
from: 0
|
||||||
to: 5
|
to: 5
|
||||||
value: visibility
|
value: visibility
|
||||||
onValueChanged: visibility = value
|
onValueChanged: visibility = value
|
||||||
}
|
}
|
||||||
|
Item { Layout.fillWidth: true }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ColumnLayout {
|
||||||
|
width: parent.width
|
||||||
TemplateLabelSmall {
|
TemplateLabelSmall {
|
||||||
Layout.columnSpan: 2
|
Layout.preferredWidth: parent.width
|
||||||
Layout.alignment: Qt.AlignLeft
|
|
||||||
text: qsTr("Notes:")
|
text: qsTr("Notes:")
|
||||||
}
|
}
|
||||||
Controls.TextArea {
|
Controls.TextArea {
|
||||||
Layout.columnSpan: 2
|
Layout.preferredWidth: parent.width
|
||||||
width: parent.width
|
width: parent.width
|
||||||
id: txtNotes
|
id: txtNotes
|
||||||
textFormat: TextEdit.RichText
|
textFormat: TextEdit.RichText
|
||||||
|
@ -643,7 +821,9 @@ Item {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
Item {
|
Item {
|
||||||
|
anchors.top: editArea.bottom
|
||||||
height: Kirigami.Units.gridUnit * 3
|
height: Kirigami.Units.gridUnit * 3
|
||||||
width: height // just to make sure the spacer doesn't produce scrollbars, but also isn't null
|
width: height // just to make sure the spacer doesn't produce scrollbars, but also isn't null
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue