summaryrefslogtreecommitdiff
path: root/src/SetPointPage.qml
diff options
context:
space:
mode:
authorArseniy Movshev <dodoradio@outlook.com>2022-11-12 23:10:12 +0000
committerArseniy Movshev <dodoradio@outlook.com>2023-01-07 14:51:55 +0000
commitd6bd9347a59df2808676a549ba81df12ecfc2d3d (patch)
tree9dc492b917a3e7ff47e97d24b43bff698816f6c8 /src/SetPointPage.qml
parent6161b765b5a2b64717de06b6f26bb7c2cf76d3d8 (diff)
Work on adding gui for dropping pins
Continue work on waypoint dialog Add experimental method of saving map positions
Diffstat (limited to 'src/SetPointPage.qml')
-rw-r--r--src/SetPointPage.qml96
1 files changed, 96 insertions, 0 deletions
diff --git a/src/SetPointPage.qml b/src/SetPointPage.qml
new file mode 100644
index 0000000..50643b0
--- /dev/null
+++ b/src/SetPointPage.qml
@@ -0,0 +1,96 @@
+import QtQuick 2.0
+import org.asteroid.controls 1.0 as Asteroid
+import QtPositioning 5.15
+import QtLocation 5.15
+import Nemo.Configuration 1.0
+
+Item {
+ id: root
+ // FlatMesh {
+ // centerColor: "#003ee9"
+ // outerColor: "#00bc1b"
+ // anchors.fill: parent
+ // }
+ Asteroid.PageHeader {
+ text: "Add waypoint"
+ }
+ ConfigurationValue {
+ id: waypointList
+ key: "/map/waypointList"
+ defaultValue: ""
+ }
+ property string selectedIcon: "ios-locate-outline"
+ property variant coord
+ 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
+ Asteroid.TextField {
+ id: textBox
+ width: parent.width
+ height: parent.width*0.2
+ //for the default text, we probably want a date/time
+ previewText: "Waypoint name"
+ text: Date().toLocaleString(Locale.ShortFormat)
+ }
+ ListView {
+ id: iconSelectorView
+ width: parent.width
+ height: width*0.2
+ orientation: ListView.Horizontal
+ model: iconModel
+ delegate: Asteroid.IconButton {
+ iconName: name
+ onClicked: root.selectedIcon = model.name
+ height: iconSelectorView.height
+ width: height
+ iconColor: root.selectedIcon == model.name ? colours.primary : colours.primaryUnselected
+ }
+ ListModel {
+ id: iconModel
+ ListElement {
+ name: "ios-locate-outline"
+ }
+ ListElement {
+ name: "ios-checkmark"
+ }
+ ListElement {
+ name: "ios-help"
+ }
+ ListElement {
+ name: "ios-information"
+ }
+ ListElement {
+ name: "ios-body-outline"
+ }
+ ListElement {
+ name: "ios-bicycle"
+ }
+ ListElement {
+ name: "ios-car-outline"
+ }
+ ListElement {
+ name: "ios-boat-outline"
+ }
+ }
+ }
+ Asteroid.IconButton {
+ width: parent.width*0.2
+ height: width
+ iconName: "ios-checkmark-circle-outline"
+ anchors.horizontalCenter: parent.horizontalCenter
+ onClicked: appendWayPoint()
+ }
+ }
+ }
+
+ function appendWayPoint() { //the colours.primary is currently a placeholder. it would be nice to let users select colours, but I CBA to write a colour picker right now.
+ var newWayPointString = ">" + "selectedIcon" + ";" + coord + ";" + colours.primary + ";" + textBox.text + ";" + Date()
+ console.log(newWayPointString)
+ pageStack.pop()
+ }
+}