mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
mobile-widgets/qml: add slot for volume change
Catch when volume type is changed and update bottomsac/decosac. Also update text l/min <-> cuft/min and add a space between value and unit. Signed-off-by: jan Iversen <jan@casacondor.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
2ef0d23c29
commit
1e14c3f0d3
1 changed files with 11 additions and 4 deletions
|
@ -10,7 +10,8 @@ import org.kde.kirigami 2.4 as Kirigami
|
||||||
Kirigami.ScrollablePage {
|
Kirigami.ScrollablePage {
|
||||||
title: qsTr("Dive planner setup")
|
title: qsTr("Dive planner setup")
|
||||||
|
|
||||||
property string speedUnit: (Backend.length === Enums.METERS) ? qsTr("m/min") : qsTr("ft/min")
|
property string speedUnit: (Backend.length === Enums.METERS) ? qsTr(" m/min") : qsTr(" ft/min")
|
||||||
|
property string volumeUnit: (Backend.volume === Enums.LITER) ? qsTr(" l/min") : qsTr(" cuft/min")
|
||||||
Connections {
|
Connections {
|
||||||
target: Backend
|
target: Backend
|
||||||
onLengthChanged: {
|
onLengthChanged: {
|
||||||
|
@ -20,6 +21,10 @@ Kirigami.ScrollablePage {
|
||||||
spinAscratelast6m.value = Backend.ascratelast6m
|
spinAscratelast6m.value = Backend.ascratelast6m
|
||||||
spinDescrate.value = Backend.descrate
|
spinDescrate.value = Backend.descrate
|
||||||
}
|
}
|
||||||
|
onVolumeChanged: {
|
||||||
|
spinBottomsac.value = Planner.bottomsac
|
||||||
|
spinDecosac.value = Planner.decosac
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Column {
|
Column {
|
||||||
width: parent.width
|
width: parent.width
|
||||||
|
@ -220,12 +225,13 @@ Kirigami.ScrollablePage {
|
||||||
text: qsTr("Bottom SAC")
|
text: qsTr("Bottom SAC")
|
||||||
}
|
}
|
||||||
TemplateSpinBox {
|
TemplateSpinBox {
|
||||||
|
id: spinBottomsac
|
||||||
from: 1
|
from: 1
|
||||||
to: 99
|
to: 99
|
||||||
stepSize: 1
|
stepSize: 1
|
||||||
value: Planner.bottomsac
|
value: Planner.bottomsac
|
||||||
textFromValue: function (value, locale) {
|
textFromValue: function (value, locale) {
|
||||||
return value + qsTr("l/min")
|
return value + volumeUnit
|
||||||
}
|
}
|
||||||
onValueModified: {
|
onValueModified: {
|
||||||
Planner.bottomsac = value
|
Planner.bottomsac = value
|
||||||
|
@ -235,12 +241,13 @@ Kirigami.ScrollablePage {
|
||||||
text: qsTr("Deco SAC")
|
text: qsTr("Deco SAC")
|
||||||
}
|
}
|
||||||
TemplateSpinBox {
|
TemplateSpinBox {
|
||||||
|
id: spinDecosac
|
||||||
from: 1
|
from: 1
|
||||||
to: 99
|
to: 99
|
||||||
stepSize: 1
|
stepSize: 1
|
||||||
value: Planner.decosac
|
value: Planner.decosac
|
||||||
textFromValue: function (value, locale) {
|
textFromValue: function (value, locale) {
|
||||||
return value + qsTr("l/min")
|
return value + volumeUnit
|
||||||
}
|
}
|
||||||
onValueModified: {
|
onValueModified: {
|
||||||
Planner.decosac = value
|
Planner.decosac = value
|
||||||
|
@ -315,7 +322,7 @@ Kirigami.ScrollablePage {
|
||||||
stepSize: 1
|
stepSize: 1
|
||||||
value: Planner.bestmixend
|
value: Planner.bestmixend
|
||||||
textFromValue: function (value, locale) {
|
textFromValue: function (value, locale) {
|
||||||
return value + qsTr("m")
|
return value + speedUnit
|
||||||
}
|
}
|
||||||
onValueModified: {
|
onValueModified: {
|
||||||
Planner.bestmixend = value
|
Planner.bestmixend = value
|
||||||
|
|
Loading…
Add table
Reference in a new issue