summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar jan Iversen <jan@casacondor.com>2020-01-01 18:28:30 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2020-01-04 10:44:02 -0800
commit342a8db93a59897bd71ae52266595754021e980a (patch)
tree4a88e14180c19835b1b75f822625b956d9ea593c
parent7e599c9ff0cbc8dbfa77e1d9179a915757518b33 (diff)
downloadsubsurface-342a8db93a59897bd71ae52266595754021e980a.tar.gz
mobile-widgets/qml: switch between m/min and ft/min
Set the text of ascent/descent rates. This shows the correct speed units when the user switches between metric and imperial. Signed-off-by: Jan Iversen <jan@casacondor.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r--mobile-widgets/qml/DivePlannerSetup.qml11
1 files changed, 6 insertions, 5 deletions
diff --git a/mobile-widgets/qml/DivePlannerSetup.qml b/mobile-widgets/qml/DivePlannerSetup.qml
index c8e192695..56e40be14 100644
--- a/mobile-widgets/qml/DivePlannerSetup.qml
+++ b/mobile-widgets/qml/DivePlannerSetup.qml
@@ -10,6 +10,7 @@ import org.kde.kirigami 2.4 as Kirigami
Kirigami.ScrollablePage {
title: qsTr("Dive planner setup")
+ property string speedUnit: (PrefUnits.length === "meters") ? qsTr("m/min") : qsTr("ft/min")
Column {
width: parent.width
spacing: 1
@@ -39,7 +40,7 @@ Kirigami.ScrollablePage {
stepSize: 1
value: Planner.ascrate75
textFromValue: function (value, locale) {
- return value + qsTr("m/min")
+ return value + speedUnit
}
onValueModified: {
Planner.ascrate75 = value
@@ -54,7 +55,7 @@ Kirigami.ScrollablePage {
stepSize: 1
value: Planner.ascrate50
textFromValue: function (value, locale) {
- return value + qsTr("m/min")
+ return value + speedUnit
}
onValueModified: {
Planner.ascrate50 = value
@@ -69,7 +70,7 @@ Kirigami.ScrollablePage {
stepSize: 1
value: Planner.ascratestops
textFromValue: function (value, locale) {
- return value + qsTr("m/min")
+ return value + speedUnit
}
onValueModified: {
Planner.ascratestops = value
@@ -84,7 +85,7 @@ Kirigami.ScrollablePage {
stepSize: 1
value: Planner.ascratelast6m
textFromValue: function (value, locale) {
- return value + qsTr("m/min")
+ return value + speedUnit
}
onValueModified: {
Planner.ascratelast6m = value
@@ -104,7 +105,7 @@ Kirigami.ScrollablePage {
stepSize: 1
value: Planner.descrate
textFromValue: function (value, locale) {
- return value + qsTr("m/min")
+ return value + speedUnit
}
onValueModified: {
Planner.descrate = value