summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar jan Iversen <jan@casacondor.com>2020-01-15 19:55:16 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2020-01-19 11:59:48 -0800
commit11c6851c74106233c6649ae1fcc954ce1b0a51a4 (patch)
treec0daa6ed78c0cdae757aec1bdbe9d3feeb7f6bbd
parent5bce4895cc1fcdc4b318ddb1724333008bc32054 (diff)
downloadsubsurface-11c6851c74106233c6649ae1fcc954ce1b0a51a4.tar.gz
mobile-widgets: move rest of gridlayout to section advanced
Create section advanced around the remaining gridlayouts, and adjust. Signed-off-by: jan Iversen <jan@casacondor.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r--mobile-widgets/qml/Settings.qml258
1 files changed, 124 insertions, 134 deletions
diff --git a/mobile-widgets/qml/Settings.qml b/mobile-widgets/qml/Settings.qml
index 1e3a067b6..29a3f271e 100644
--- a/mobile-widgets/qml/Settings.qml
+++ b/mobile-widgets/qml/Settings.qml
@@ -380,164 +380,154 @@ Kirigami.ScrollablePage {
}
}
- GridLayout {
- id: gpsPrefs
- columns: 2
-
- TemplateLabel {
- text: qsTr("GPS location service")
- font.pointSize: subsurfaceTheme.headingPointSize
- font.weight: Font.Light
- Layout.topMargin: Kirigami.Units.largeSpacing
- Layout.bottomMargin: Kirigami.Units.largeSpacing / 2
- Layout.columnSpan: 2
- }
+ TemplateSection {
+ id: sectionAdvanced
+ title: qsTr("Advanced")
- TemplateLabel {
- text: qsTr("Distance threshold (meters)")
- Layout.preferredWidth: gridWidth * 0.75
- }
+ GridLayout {
+ id: gpsPrefs
+ visible: sectionAdvanced.isExpanded
+ columns: 2
- TemplateTextField {
- id: distanceThreshold
- text: PrefLocationService.distance_threshold
- Layout.preferredWidth: gridWidth * 0.25
- onEditingFinished: {
- PrefLocationService.distance_threshold = distanceThreshold.text
+ TemplateLabel {
+ text: qsTr("GPS location service")
+ font.pointSize: subsurfaceTheme.headingPointSize
+ font.weight: Font.Light
+ Layout.topMargin: Kirigami.Units.largeSpacing
+ Layout.bottomMargin: Kirigami.Units.largeSpacing / 2
+ Layout.columnSpan: 2
}
- }
- TemplateLabel {
- text: qsTr("Time threshold (minutes)")
- Layout.preferredWidth: gridWidth * 0.75
- }
-
- TemplateTextField {
- id: timeThreshold
- text: PrefLocationService.time_threshold / 60
- Layout.preferredWidth: gridWidth * 0.25
- onEditingFinished: {
- PrefLocationService.time_threshold = timeThreshold.text * 60
+ TemplateLabel {
+ text: qsTr("Distance threshold (meters)")
+ Layout.preferredWidth: gridWidth * 0.75
}
- }
- }
- Rectangle {
- color: subsurfaceTheme.darkerPrimaryColor
- height: 1
- opacity: 0.5
- Layout.fillWidth: true
- }
-
- GridLayout {
- id: filterPrefs
- columns: 2
+ TemplateTextField {
+ id: distanceThreshold
+ text: PrefLocationService.distance_threshold
+ Layout.preferredWidth: gridWidth * 0.25
+ onEditingFinished: {
+ PrefLocationService.distance_threshold = distanceThreshold.text
+ }
+ }
- TemplateLabel {
- text: qsTr("Filter preferences")
- font.pointSize: subsurfaceTheme.headingPointSize
- font.weight: Font.Light
- Layout.topMargin: Kirigami.Units.largeSpacing
- Layout.bottomMargin: Kirigami.Units.largeSpacing / 2
- Layout.columnSpan: 2
- }
- TemplateLabel {
- text: qsTr("Include notes in full text filtering")
- Layout.preferredWidth: gridWidth * 0.75
- }
+ TemplateLabel {
+ text: qsTr("Time threshold (minutes)")
+ Layout.preferredWidth: gridWidth * 0.75
+ }
- SsrfSwitch {
- id: fullTextNotes
- checked: PrefGeneral.filterFullTextNotes
- Layout.preferredWidth: gridWidth * 0.25
- onClicked: {
- PrefGeneral.filterFullTextNotes = checked
+ TemplateTextField {
+ id: timeThreshold
+ text: PrefLocationService.time_threshold / 60
+ Layout.preferredWidth: gridWidth * 0.25
+ onEditingFinished: {
+ PrefLocationService.time_threshold = timeThreshold.text * 60
+ }
}
}
-
- TemplateLabel {
- text: qsTr("Match filter case sensitive")
- Layout.preferredWidth: gridWidth * 0.75
+ TemplateLine {
+ visible: sectionAdvanced.isExpanded
}
+ GridLayout {
+ id: filterPrefs
+ visible: sectionAdvanced.isExpanded
+ columns: 2
- SsrfSwitch {
- id: filterCaseSensitive
- checked: PrefGeneral.filterCaseSensitive
- Layout.preferredWidth: gridWidth * 0.25
- onClicked: {
- PrefGeneral.filterCaseSensitive = checked
+ TemplateLabel {
+ text: qsTr("Filter preferences")
+ font.pointSize: subsurfaceTheme.headingPointSize
+ font.weight: Font.Light
+ Layout.topMargin: Kirigami.Units.largeSpacing
+ Layout.bottomMargin: Kirigami.Units.largeSpacing / 2
+ Layout.columnSpan: 2
+ }
+ TemplateLabel {
+ text: qsTr("Include notes in full text filtering")
+ Layout.preferredWidth: gridWidth * 0.75
}
- }
- }
+ SsrfSwitch {
+ id: fullTextNotes
+ checked: PrefGeneral.filterFullTextNotes
+ Layout.preferredWidth: gridWidth * 0.25
+ onClicked: {
+ PrefGeneral.filterFullTextNotes = checked
+ }
+ }
- Rectangle {
- color: subsurfaceTheme.darkerPrimaryColor
- height: 1
- opacity: 0.5
- Layout.fillWidth: true
- }
+ TemplateLabel {
+ text: qsTr("Match filter case sensitive")
+ Layout.preferredWidth: gridWidth * 0.75
+ }
- GridLayout {
- id: whichBluetoothDevices
- columns: 2
- TemplateLabel {
- text: qsTr("Bluetooth")
- font.pointSize: subsurfaceTheme.headingPointSize
- font.weight: Font.Light
- Layout.topMargin: Kirigami.Units.largeSpacing
- Layout.bottomMargin: Kirigami.Units.largeSpacing / 2
- Layout.columnSpan: 2
+ SsrfSwitch {
+ id: filterCaseSensitive
+ checked: PrefGeneral.filterCaseSensitive
+ Layout.preferredWidth: gridWidth * 0.25
+ onClicked: {
+ PrefGeneral.filterCaseSensitive = checked
+ }
+ }
}
-
- TemplateLabel {
- text: qsTr("Temporarily show all bluetooth devices \neven if not recognized as dive computers.\nPlease report DCs that need this setting")
- Layout.preferredWidth: gridWidth * 0.75
+ TemplateLine {
+ visible: sectionAdvanced.isExpanded
}
- SsrfSwitch {
- id: nonDCButton
- checked: manager.showNonDiveComputers
- Layout.preferredWidth: gridWidth * 0.25
- onClicked: {
- manager.showNonDiveComputers = checked
+ GridLayout {
+ id: whichBluetoothDevices
+ visible: sectionAdvanced.isExpanded
+ columns: 2
+ TemplateLabel {
+ text: qsTr("Bluetooth")
+ font.pointSize: subsurfaceTheme.headingPointSize
+ font.weight: Font.Light
+ Layout.topMargin: Kirigami.Units.largeSpacing
+ Layout.bottomMargin: Kirigami.Units.largeSpacing / 2
+ Layout.columnSpan: 2
}
- }
- }
-
- Rectangle {
- color: subsurfaceTheme.darkerPrimaryColor
- height: 1
- opacity: 0.5
- Layout.fillWidth: true
- }
- GridLayout {
- id: developer
- columns: 2
- TemplateLabel {
- text: qsTr("Developer")
- font.pointSize: subsurfaceTheme.headingPointSize
- font.weight: Font.Light
- Layout.topMargin: Kirigami.Units.largeSpacing
- Layout.bottomMargin: Kirigami.Units.largeSpacing / 2
- Layout.columnSpan: 2
+ TemplateLabel {
+ text: qsTr("Temporarily show all bluetooth devices \neven if not recognized as dive computers.\nPlease report DCs that need this setting")
+ Layout.preferredWidth: gridWidth * 0.75
+ }
+ SsrfSwitch {
+ id: nonDCButton
+ checked: manager.showNonDiveComputers
+ Layout.preferredWidth: gridWidth * 0.25
+ onClicked: {
+ manager.showNonDiveComputers = checked
+ }
+ }
}
-
- TemplateLabel {
- text: qsTr("Display Developer menu")
- Layout.preferredWidth: gridWidth * 0.75
+ TemplateLine {
+ visible: sectionAdvanced.isExpanded
}
- SsrfSwitch {
- id: developerButton
- checked: PrefDisplay.show_developer
- Layout.preferredWidth: gridWidth * 0.25
- onClicked: {
- PrefDisplay.show_developer = checked
+ GridLayout {
+ id: developer
+ visible: sectionAdvanced.isExpanded
+ columns: 2
+ TemplateLabel {
+ text: qsTr("Developer")
+ font.pointSize: subsurfaceTheme.headingPointSize
+ font.weight: Font.Light
+ Layout.topMargin: Kirigami.Units.largeSpacing
+ Layout.bottomMargin: Kirigami.Units.largeSpacing / 2
+ Layout.columnSpan: 2
+ }
+
+ TemplateLabel {
+ text: qsTr("Display Developer menu")
+ Layout.preferredWidth: gridWidth * 0.75
+ }
+ SsrfSwitch {
+ id: developerButton
+ checked: PrefDisplay.show_developer
+ Layout.preferredWidth: gridWidth * 0.25
+ onClicked: {
+ PrefDisplay.show_developer = checked
+ }
}
}
}
- Item {
- height: Kirigami.Units.gridUnit * 6
- }
}
}