mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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>
This commit is contained in:
parent
7e599c9ff0
commit
342a8db93a
1 changed files with 6 additions and 5 deletions
|
@ -10,6 +10,7 @@ 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: (PrefUnits.length === "meters") ? qsTr("m/min") : qsTr("ft/min")
|
||||||
Column {
|
Column {
|
||||||
width: parent.width
|
width: parent.width
|
||||||
spacing: 1
|
spacing: 1
|
||||||
|
@ -39,7 +40,7 @@ Kirigami.ScrollablePage {
|
||||||
stepSize: 1
|
stepSize: 1
|
||||||
value: Planner.ascrate75
|
value: Planner.ascrate75
|
||||||
textFromValue: function (value, locale) {
|
textFromValue: function (value, locale) {
|
||||||
return value + qsTr("m/min")
|
return value + speedUnit
|
||||||
}
|
}
|
||||||
onValueModified: {
|
onValueModified: {
|
||||||
Planner.ascrate75 = value
|
Planner.ascrate75 = value
|
||||||
|
@ -54,7 +55,7 @@ Kirigami.ScrollablePage {
|
||||||
stepSize: 1
|
stepSize: 1
|
||||||
value: Planner.ascrate50
|
value: Planner.ascrate50
|
||||||
textFromValue: function (value, locale) {
|
textFromValue: function (value, locale) {
|
||||||
return value + qsTr("m/min")
|
return value + speedUnit
|
||||||
}
|
}
|
||||||
onValueModified: {
|
onValueModified: {
|
||||||
Planner.ascrate50 = value
|
Planner.ascrate50 = value
|
||||||
|
@ -69,7 +70,7 @@ Kirigami.ScrollablePage {
|
||||||
stepSize: 1
|
stepSize: 1
|
||||||
value: Planner.ascratestops
|
value: Planner.ascratestops
|
||||||
textFromValue: function (value, locale) {
|
textFromValue: function (value, locale) {
|
||||||
return value + qsTr("m/min")
|
return value + speedUnit
|
||||||
}
|
}
|
||||||
onValueModified: {
|
onValueModified: {
|
||||||
Planner.ascratestops = value
|
Planner.ascratestops = value
|
||||||
|
@ -84,7 +85,7 @@ Kirigami.ScrollablePage {
|
||||||
stepSize: 1
|
stepSize: 1
|
||||||
value: Planner.ascratelast6m
|
value: Planner.ascratelast6m
|
||||||
textFromValue: function (value, locale) {
|
textFromValue: function (value, locale) {
|
||||||
return value + qsTr("m/min")
|
return value + speedUnit
|
||||||
}
|
}
|
||||||
onValueModified: {
|
onValueModified: {
|
||||||
Planner.ascratelast6m = value
|
Planner.ascratelast6m = value
|
||||||
|
@ -104,7 +105,7 @@ Kirigami.ScrollablePage {
|
||||||
stepSize: 1
|
stepSize: 1
|
||||||
value: Planner.descrate
|
value: Planner.descrate
|
||||||
textFromValue: function (value, locale) {
|
textFromValue: function (value, locale) {
|
||||||
return value + qsTr("m/min")
|
return value + speedUnit
|
||||||
}
|
}
|
||||||
onValueModified: {
|
onValueModified: {
|
||||||
Planner.descrate = value
|
Planner.descrate = value
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue