mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Mobile: add units selection to settings page
Add the option for the user to set the desired unit system for Subsurface-mobile regardless of system locale Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
c11a4e4633
commit
a63be142b5
1 changed files with 50 additions and 0 deletions
|
@ -339,6 +339,56 @@ Kirigami.ScrollablePage {
|
||||||
opacity: 0.5
|
opacity: 0.5
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
}
|
}
|
||||||
|
GridLayout {
|
||||||
|
id: unit_system
|
||||||
|
columns: 2
|
||||||
|
width: parent.width - Kirigami.Units.gridUnit
|
||||||
|
Kirigami.Heading {
|
||||||
|
text: qsTr("Units")
|
||||||
|
color: subsurfaceTheme.textColor
|
||||||
|
level: 4
|
||||||
|
Layout.topMargin: Kirigami.Units.largeSpacing
|
||||||
|
Layout.bottomMargin: Kirigami.Units.largeSpacing / 2
|
||||||
|
Layout.columnSpan: 2
|
||||||
|
}
|
||||||
|
|
||||||
|
Controls.Label {
|
||||||
|
text: qsTr("Use Imperial Units")
|
||||||
|
Layout.preferredWidth: gridWidth * 0.75
|
||||||
|
}
|
||||||
|
SsrfSwitch {
|
||||||
|
id: imperialButton
|
||||||
|
checked: PrefUnits.unit_system === "imperial"
|
||||||
|
enabled: PrefUnits.unit_system === "metric"
|
||||||
|
Layout.preferredWidth: gridWidth * 0.25
|
||||||
|
onClicked: {
|
||||||
|
PrefUnits.set_unit_system("imperial")
|
||||||
|
manager.changesNeedSaving()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Controls.Label {
|
||||||
|
text: qsTr("Use Metric Units")
|
||||||
|
Layout.preferredWidth: gridWidth * 0.75
|
||||||
|
}
|
||||||
|
SsrfSwitch {
|
||||||
|
id: metricButtton
|
||||||
|
checked: PrefUnits.unit_system === "metric"
|
||||||
|
enabled: PrefUnits.unit_system === "imperial"
|
||||||
|
Layout.preferredWidth: gridWidth * 0.25
|
||||||
|
onClicked: {
|
||||||
|
PrefUnits.set_unit_system("metric")
|
||||||
|
manager.changesNeedSaving()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Rectangle {
|
||||||
|
color: subsurfaceTheme.darkerPrimaryColor
|
||||||
|
height: 1
|
||||||
|
opacity: 0.5
|
||||||
|
Layout.fillWidth: true
|
||||||
|
}
|
||||||
|
|
||||||
GridLayout {
|
GridLayout {
|
||||||
id: developer
|
id: developer
|
||||||
columns: 2
|
columns: 2
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue