From ba7a8f68bc4e3ddf42a1ff272dc369a4138229fb Mon Sep 17 00:00:00 2001 From: jan Iversen Date: Wed, 15 Jan 2020 19:36:38 +0100 Subject: [PATCH] mobile-widgets/qml: move dive computers to general section. move gridlayout divecomputers to TemplateSection general, without changing anything (apart from adding a visible: attribute and replacing the Rectangle used to draw a line at the bottom with a TemplateLine on top. Signed-off-by: jan Iversen Signed-off-by: Dirk Hohndel --- mobile-widgets/qml/Settings.qml | 67 ++++++++++++++++----------------- 1 file changed, 32 insertions(+), 35 deletions(-) diff --git a/mobile-widgets/qml/Settings.qml b/mobile-widgets/qml/Settings.qml index 0f97df880..aff9503b9 100644 --- a/mobile-widgets/qml/Settings.qml +++ b/mobile-widgets/qml/Settings.qml @@ -98,6 +98,38 @@ Kirigami.ScrollablePage { } } } + TemplateLine { + visible: sectionGeneral.isExpanded + } + GridLayout { + id: divecomputers + visible: sectionGeneral.isExpanded + columns: 2 + TemplateLabel { + text: qsTr("Dive computers") + font.pointSize: subsurfaceTheme.headingPointSize + font.weight: Font.Light + Layout.topMargin: Kirigami.Units.largeSpacing + Layout.bottomMargin: Kirigami.Units.largeSpacing + Layout.columnSpan: 2 + } + TemplateLabel { + text: qsTr("Forget remembered dive computers") + Layout.preferredWidth: gridWidth * 0.75 + } + SsrfButton { + id: forgetDCButton + text: qsTr("Forget") + enabled: PrefDiveComputer.vendor1 !== "" + onClicked: { + PrefDiveComputer.vendor1 = PrefDiveComputer.product1 = PrefDiveComputer.device1 = "" + PrefDiveComputer.vendor2 = PrefDiveComputer.product2 = PrefDiveComputer.device2 = "" + PrefDiveComputer.vendor3 = PrefDiveComputer.product3 = PrefDiveComputer.device3 = "" + PrefDiveComputer.vendor4 = PrefDiveComputer.product4 = PrefDiveComputer.device4 = "" + PrefDiveComputer.vendor = PrefDiveComputer.product = PrefDiveComputer.device = "" + } + } + } } @@ -365,41 +397,6 @@ Kirigami.ScrollablePage { Layout.fillWidth: true } - GridLayout { - id: divecomputers - columns: 2 - TemplateLabel { - text: qsTr("Dive computers") - font.pointSize: subsurfaceTheme.headingPointSize - font.weight: Font.Light - Layout.topMargin: Kirigami.Units.largeSpacing - Layout.bottomMargin: Kirigami.Units.largeSpacing - Layout.columnSpan: 2 - } - TemplateLabel { - text: qsTr("Forget remembered dive computers") - Layout.preferredWidth: gridWidth * 0.75 - } - SsrfButton { - id: forgetDCButton - text: qsTr("Forget") - enabled: PrefDiveComputer.vendor1 !== "" - onClicked: { - PrefDiveComputer.vendor1 = PrefDiveComputer.product1 = PrefDiveComputer.device1 = "" - PrefDiveComputer.vendor2 = PrefDiveComputer.product2 = PrefDiveComputer.device2 = "" - PrefDiveComputer.vendor3 = PrefDiveComputer.product3 = PrefDiveComputer.device3 = "" - PrefDiveComputer.vendor4 = PrefDiveComputer.product4 = PrefDiveComputer.device4 = "" - PrefDiveComputer.vendor = PrefDiveComputer.product = PrefDiveComputer.device = "" - } - } - } - - Rectangle { - color: subsurfaceTheme.darkerPrimaryColor - height: 1 - opacity: 0.5 - Layout.fillWidth: true - } GridLayout { id: unit_system columns: 2