aboutsummaryrefslogtreecommitdiffstats
path: root/mobile-widgets/qml
diff options
context:
space:
mode:
authorGravatar Joakim Bygdell <j.bygdell@gmail.com>2017-07-19 20:57:12 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2017-07-23 03:20:58 +0900
commite80132cdef038fdff253f59979fbb8789e325315 (patch)
tree99837f60f4d12c569efbb5f7dbbcfb0bbe1e249c /mobile-widgets/qml
parent98268a0c7e0ccff3a6d1479edfea6246e0d4cfe3 (diff)
downloadsubsurface-e80132cdef038fdff253f59979fbb8789e325315.tar.gz
QML UI: move location service to preferences page
Move the locations service switch to the GPS section of the preferences page. Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
Diffstat (limited to 'mobile-widgets/qml')
-rw-r--r--mobile-widgets/qml/Preferences.qml35
-rw-r--r--mobile-widgets/qml/main.qml49
2 files changed, 35 insertions, 49 deletions
diff --git a/mobile-widgets/qml/Preferences.qml b/mobile-widgets/qml/Preferences.qml
index 2a12e71ac..7335b0a31 100644
--- a/mobile-widgets/qml/Preferences.qml
+++ b/mobile-widgets/qml/Preferences.qml
@@ -279,6 +279,41 @@ Kirigami.ScrollablePage {
}
}
GridLayout {
+ id: locationService
+ columns: 2
+ width: parent.width
+ CheckBox {
+ id: locationCheckbox
+ visible: manager.locationServiceAvailable
+ checked: manager.locationServiceEnabled
+ onClicked: {
+ manager.locationServiceEnabled = checked
+ }
+ indicator: Rectangle {
+ implicitWidth: 20
+ implicitHeight: 20
+ x: locationCheckbox.leftPadding
+ y: parent.height / 2 - height / 2
+ radius: 4
+ border.color: locationCheckbox.down ? subsurfaceTheme.primaryColor : subsurfaceTheme.darkerPrimaryColor
+ color: subsurfaceTheme.backgroundColor
+
+ Rectangle {
+ width: 12
+ height: 12
+ x: 4
+ y: 4
+ radius: 3
+ color: locationCheckbox.down ? subsurfaceTheme.primaryColor : subsurfaceTheme.darkerPrimaryColor
+ visible: locationCheckbox.checked
+ }
+ }
+ }
+ Kirigami.Label {
+ text: qsTr("Run location service")
+ }
+ }
+ GridLayout {
id: libdclogprefs
columns: 2
width: parent.width
diff --git a/mobile-widgets/qml/main.qml b/mobile-widgets/qml/main.qml
index 9dedb190b..0ba47743e 100644
--- a/mobile-widgets/qml/main.qml
+++ b/mobile-widgets/qml/main.qml
@@ -290,55 +290,6 @@ if you have network connectivity and want to sync your data to cloud storage."),
}
] // end actions
- MouseArea {
- height: childrenRect.height
- width: Kirigami.Units.gridUnit * 10
- CheckBox {
- //text: qsTr("Run location service")
- id: locationCheckbox
- visible: manager.locationServiceAvailable
- anchors {
- left: parent.left
- top: parent.top
- }
- checked: manager.locationServiceEnabled
- onCheckedChanged: {
- manager.locationServiceEnabled = checked;
- }
- indicator: Rectangle {
- implicitWidth: 20
- implicitHeight: 20
- x: locationCheckbox.leftPadding
- y: parent.height / 2 - height / 2
- radius: 4
- border.color: locationCheckbox.down ? subsurfaceTheme.primaryColor : subsurfaceTheme.darkerPrimaryColor
- color: subsurfaceTheme.drawerColor
-
- Rectangle {
- width: 12
- height: 12
- x: 4
- y: 4
- radius: 3
- color: locationCheckbox.down ? subsurfaceTheme.primaryColor : subsurfaceTheme.darkerPrimaryColor
- visible: locationCheckbox && locationCheckbox.checked
- }
- }
- }
- Kirigami.Label {
- x: Kirigami.Units.gridUnit * 1.5
- anchors {
- left: locationCheckbox.right
- //leftMargin: units.smallSpacing
- verticalCenter: locationCheckbox.verticalCenter
- }
- text: Qt.platform.os == "ios" ? "" : manager.locationServiceAvailable ? qsTr("Run location service") : qsTr("No GPS source available")
- }
- onClicked: {
- print("Click.")
- locationCheckbox.checked = !locationCheckbox.checked
- }
- }
}
function blueTheme() {