diff --git a/mobile-widgets/qml/CloudCredentials.qml b/mobile-widgets/qml/CloudCredentials.qml index d69f0476c..9a7a8c2bd 100644 --- a/mobile-widgets/qml/CloudCredentials.qml +++ b/mobile-widgets/qml/CloudCredentials.qml @@ -9,7 +9,7 @@ import org.subsurfacedivelog.mobile 1.0 Item { id: loginWindow - height: outerLayout.height + 2 * Kirigami.Units.gridUnit + height: outerLayout.height property string username: login.text; property string password: password.text; @@ -82,7 +82,7 @@ Item { GridLayout { columns: 2 - CheckBox { + Switch { checked: false id: showPassword onCheckedChanged: { @@ -104,7 +104,5 @@ Item { Layout.fillWidth: true visible: rootItem.showPin } - - Item { width: Kirigami.Units.gridUnit; height: width } } } diff --git a/mobile-widgets/qml/Preferences.qml b/mobile-widgets/qml/Settings.qml similarity index 92% rename from mobile-widgets/qml/Preferences.qml rename to mobile-widgets/qml/Settings.qml index 7335b0a31..3a0e36478 100644 --- a/mobile-widgets/qml/Preferences.qml +++ b/mobile-widgets/qml/Settings.qml @@ -8,8 +8,8 @@ import org.kde.kirigami 2.0 as Kirigami import org.subsurfacedivelog.mobile 1.0 Kirigami.ScrollablePage { - objectName: "Preferences" - title: qsTr("Preferences") + objectName: "Settings" + title: qsTr("Settings") anchors.margins: Kirigami.Units.gridUnit / 2 actions { @@ -27,9 +27,24 @@ Kirigami.ScrollablePage { } ColumnLayout { width: parent.width - Kirigami.Units.gridUnit + CloudCredentials { + id: cloudCredentials + Layout.fillWidth: true + Layout.margins: Kirigami.Units.gridUnit + Layout.topMargin: 0 + property int headingLevel: 4 + } + Rectangle { + color: subsurfaceTheme.darkerPrimaryColor + height: 1 + opacity: 0.5 + Layout.columnSpan: 3 + Layout.fillWidth: true + } GridLayout { - id: themePrefs + id: themeSettings columns: 2 + Layout.bottomMargin: Kirigami.Units.gridUnit Kirigami.Heading { text: qsTr("Theme") @@ -39,7 +54,6 @@ Kirigami.ScrollablePage { Layout.bottomMargin: Kirigami.Units.largeSpacing / 2 Layout.columnSpan: 2 } - RadioButton { id: bluebutton checked: subsurfaceTheme.currentTheme === "Blue" @@ -238,6 +252,13 @@ Kirigami.ScrollablePage { } } } + Rectangle { + color: subsurfaceTheme.darkerPrimaryColor + height: 1 + opacity: 0.5 + Layout.columnSpan: 3 + Layout.fillWidth: true + } GridLayout { id: gpsPrefs columns: 2 @@ -278,6 +299,13 @@ Kirigami.ScrollablePage { Layout.fillHeight: true } } + Rectangle { + color: subsurfaceTheme.darkerPrimaryColor + height: 1 + opacity: 0.5 + Layout.columnSpan: 3 + Layout.fillWidth: true + } GridLayout { id: locationService columns: 2 @@ -318,7 +346,7 @@ Kirigami.ScrollablePage { columns: 2 width: parent.width Kirigami.Heading { - text: qsTr("Debug log for download from divecomputer") + text: qsTr("Dive computer") color: subsurfaceTheme.textColor level: 4 Layout.topMargin: Kirigami.Units.largeSpacing @@ -326,31 +354,12 @@ Kirigami.ScrollablePage { Layout.columnSpan: 2 } - CheckBox { + Switch { id: libdclogButton checked: manager.libdcLog onClicked: { manager.libdcLog = checked } - indicator: Rectangle { - implicitWidth: 20 - implicitHeight: 20 - x: libdclogButton.leftPadding - y: parent.height / 2 - height / 2 - radius: 4 - border.color: libdclogButton.down ? subsurfaceTheme.primaryColor : subsurfaceTheme.darkerPrimaryColor - color: subsurfaceTheme.backgroundColor - - Rectangle { - width: 12 - height: 12 - x: 4 - y: 4 - radius: 3 - color: libdclogButton.down ? subsurfaceTheme.primaryColor : subsurfaceTheme.darkerPrimaryColor - visible: libdclogButton.checked - } - } } Kirigami.Label { text: qsTr("Save detailed log of interaction with the dive computer") diff --git a/mobile-widgets/qml/StartPage.qml b/mobile-widgets/qml/StartPage.qml index abc1acc09..e988fb9e9 100644 --- a/mobile-widgets/qml/StartPage.qml +++ b/mobile-widgets/qml/StartPage.qml @@ -39,5 +39,6 @@ Kirigami.ScrollablePage { Layout.topMargin: 0 property int headingLevel: 3 } + Item { width: Kirigami.Units.gridUnit; height: 3 * Kirigami.Units.gridUnit} } } diff --git a/mobile-widgets/qml/main.qml b/mobile-widgets/qml/main.qml index 0ba47743e..6ff17bc41 100644 --- a/mobile-widgets/qml/main.qml +++ b/mobile-widgets/qml/main.qml @@ -242,25 +242,9 @@ if you have network connectivity and want to sync your data to cloud storage."), Kirigami.Action { iconName: "icons/ic_settings.svg" text: qsTr("Settings") - Kirigami.Action { - text: qsTr("Cloud credentials") - onTriggered: { - returnTopPage() - oldStatus = manager.credentialStatus - if (diveList.numDives > 0) { - manager.startPageText = "Enter different credentials or return to dive list" - } else { - manager.startPageText = "Enter valid cloud storage credentials" - } - manager.credentialStatus = QMLManager.UNKNOWN - } - } - Kirigami.Action { - text: qsTr("Preferences") - onTriggered: { - stackView.push(prefsWindow) - detailsWindow.endEditMode() - } + onTriggered: { + stackView.push(settingsWindow) + detailsWindow.endEditMode() } }, Kirigami.Action { @@ -438,8 +422,8 @@ if you have network connectivity and want to sync your data to cloud storage."), id: manager } - Preferences { - id: prefsWindow + Settings { + id: settingsWindow visible: false } diff --git a/mobile-widgets/qml/mobile-resources.qrc b/mobile-widgets/qml/mobile-resources.qrc index d135a84cd..66a3ee646 100644 --- a/mobile-widgets/qml/mobile-resources.qrc +++ b/mobile-widgets/qml/mobile-resources.qrc @@ -1,7 +1,6 @@ main.qml - Preferences.qml About.qml CloudCredentials.qml DiveList.qml @@ -13,6 +12,7 @@ GpsList.qml HintsTextEdit.qml Log.qml + Settings.qml ThemeTest.qml StartPage.qml dive.jpg