From 11c6851c74106233c6649ae1fcc954ce1b0a51a4 Mon Sep 17 00:00:00 2001 From: jan Iversen Date: Wed, 15 Jan 2020 19:55:16 +0100 Subject: mobile-widgets: move rest of gridlayout to section advanced Create section advanced around the remaining gridlayouts, and adjust. Signed-off-by: jan Iversen Signed-off-by: Dirk Hohndel --- mobile-widgets/qml/Settings.qml | 258 +++++++++++++++++++--------------------- 1 file changed, 124 insertions(+), 134 deletions(-) (limited to 'mobile-widgets') 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 - } } } -- cgit v1.2.3-70-g09d2