aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArseniy Movshev <dodoradio@outlook.com>2022-10-22 14:35:59 +0100
committerArseniy Movshev <dodoradio@outlook.com>2023-01-07 14:19:29 +0000
commitcf634a3ed47e756d70f0228044ebd0be794886f9 (patch)
treefc45a5adae1088a8ff61b886d0cae9f7a457db60
parent95c72f71f9382e3bf2918892edc1e7137391554d (diff)
Add a settings page
-rw-r--r--src/MainMapView.qml15
-rw-r--r--src/SettingsPage.qml60
-rw-r--r--src/main.qml11
-rw-r--r--src/resources.qrc1
4 files changed, 74 insertions, 13 deletions
diff --git a/src/MainMapView.qml b/src/MainMapView.qml
index 9a00a45..82815f9 100644
--- a/src/MainMapView.qml
+++ b/src/MainMapView.qml
@@ -4,6 +4,11 @@ import QtPositioning 5.15
import QtLocation 5.15
Item {
+ Label {
+ text: "Map Data from OpenStreetMap"
+ anchors.centerIn: parent
+ z: 0
+ }
Map {
id: mapView
plugin: mapProvider
@@ -20,7 +25,7 @@ Item {
width: height
iconColor: "blue"
z: 2
- onClicked: mapView.zoomLevel = mapView.zoomLevel + 0.1
+ onClicked: mapView.zoomLevel = mapView.zoomLevel + 0.3
}
IconButton {
iconName: "ios-remove-circle-outline"
@@ -30,7 +35,7 @@ Item {
width: height
iconColor: "blue"
z: 2
- onClicked: mapView.zoomLevel = mapView.zoomLevel - 0.1
+ onClicked: mapView.zoomLevel = mapView.zoomLevel - 0.3
}
IconButton {
iconName: "ios-locate-outline"
@@ -49,10 +54,6 @@ Item {
width: height
iconColor: "blue"
z: 2
- // Icon {
- // anchors.fill: parent
- // name: "ios-circle-outline"
- // // color: parent.iconColor
- // }
+ onClicked: pageStack.push(settingsPage,{})
}
}
diff --git a/src/SettingsPage.qml b/src/SettingsPage.qml
new file mode 100644
index 0000000..189ebe4
--- /dev/null
+++ b/src/SettingsPage.qml
@@ -0,0 +1,60 @@
+import QtQuick 2.0
+import org.asteroid.controls 1.0
+import QtPositioning 5.15
+import QtLocation 5.15
+
+Item {
+ id: root
+ PageHeader {
+ text: "Map settings"
+ }
+ Flickable {
+ anchors.fill: parent
+ contentHeight: contentColumn.implicitHeight
+ anchors.leftMargin: root.width*0.15
+ anchors.rightMargin: root.width*0.15
+ Column {
+ id: contentColumn
+ anchors.fill: parent
+ Item {
+ height: root.height*0.1
+ width: parent.width
+ }
+ LabeledSwitch {
+ width: parent.width
+ height: width*0.2
+ text: "show zoom controls"
+ }
+ LabeledSwitch {
+ width: parent.width
+ height: width*0.2
+ text: "center on GPS"
+ }
+ Row {
+ width: parent.width
+ height: width*0.2
+ // Icon {
+ // name: "ios-information-circle-outline"
+ // height: parent.height
+ // width: height
+ // }
+ Column {
+ height: parent.height
+ width: parent.width - parent.height
+ Label {
+ text: "Map Data © OpenStreetMap contributors"
+ height: parent.height*0.5
+ width: parent.width
+ font.pixelSize: root.width*0.05
+ }
+ Label {
+ text: "under the ODbL"
+ height: parent.height*0.5
+ width: parent.width
+ font.pixelSize: root.width*0.05
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/src/main.qml b/src/main.qml
index 5442abc..693e9d4 100644
--- a/src/main.qml
+++ b/src/main.qml
@@ -9,17 +9,12 @@ Application {
centerColor: "#9800A6"
outerColor: "#0C0009"
- Label {
- text: "Map Data from OpenStreetMap"
- anchors.centerIn: parent
- z: 0
- }
Plugin {
id: mapProvider
name: "osm"
}
LayerStack {
- id: pagestack
+ id: pageStack
anchors.fill: parent
firstPage: mainmapview
}
@@ -28,4 +23,8 @@ Application {
id: mainmapview
MainMapView {}
}
+ Component {
+ id: settingsPage
+ SettingsPage {}
+ }
}
diff --git a/src/resources.qrc b/src/resources.qrc
index bd1509f..66c9640 100644
--- a/src/resources.qrc
+++ b/src/resources.qrc
@@ -2,5 +2,6 @@
<qresource prefix="/">
<file>main.qml</file>
<file>MainMapView.qml</file>
+ <file>SettingsPage.qml</file>
</qresource>
</RCC>