aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorArseniy Movshev <dodoradio@outlook.com>2023-01-07 19:22:04 +0000
committerArseniy Movshev <dodoradio@outlook.com>2023-01-07 20:20:07 +0000
commit7dfd22e942567bf151a8d373a64e6aed2e662b89 (patch)
tree920d4947d68290362cd5fd22d546397c15fa0f39 /src
parent920f90cff9ce91943227c1dad4e6d3577021b4f8 (diff)
Add a page for editing and deleting waypoints
Diffstat (limited to '')
-rw-r--r--src/MainMapView.qml4
-rw-r--r--src/MapWaypoint.qml2
-rw-r--r--src/SetPointPage.qml30
3 files changed, 24 insertions, 12 deletions
diff --git a/src/MainMapView.qml b/src/MainMapView.qml
index 2cefbeb..40c42c8 100644
--- a/src/MainMapView.qml
+++ b/src/MainMapView.qml
@@ -78,6 +78,7 @@ Item {
mapItem.coordinate = QtPositioning.coordinate(currWaypointCoord[0],currWaypointCoord[1])
mapItem.iconName = currWaypointData[0]
mapItem.iconColor = currWaypointData[2]
+ mapItem.index = i
mapView.addMapItem(mapItem)
}
}
@@ -96,6 +97,9 @@ Item {
pageStack.push(setPointPage,{coord: mapView.center})
}
}
+ function editWaypoint(number) {
+ console.log("invoking the edit page for waypoint number ", number)
+ }
Component {
id: waypoint
MapWaypoint {
diff --git a/src/MapWaypoint.qml b/src/MapWaypoint.qml
index 3a56dcc..f40f62d 100644
--- a/src/MapWaypoint.qml
+++ b/src/MapWaypoint.qml
@@ -11,6 +11,7 @@ MapQuickItem {
autoFadeIn: false
property string iconName
property color iconColor
+ property int index
sourceItem: Asteroid.IconButton {
width: Asteroid.Dims.w(12)
iconName: "waypoint"
@@ -23,5 +24,6 @@ MapQuickItem {
name: root.iconName
color: root.iconColor
}
+ onClicked: editWaypoint(index)
}
}
diff --git a/src/SetPointPage.qml b/src/SetPointPage.qml
index e036001..1b5f571 100644
--- a/src/SetPointPage.qml
+++ b/src/SetPointPage.qml
@@ -6,11 +6,6 @@ import Nemo.Configuration 1.0
Item {
id: root
- // FlatMesh {
- // centerColor: "#003ee9"
- // outerColor: "#00bc1b"
- // anchors.fill: parent
- // }
Asteroid.PageHeader {
text: "Add waypoint"
}
@@ -41,7 +36,7 @@ Item {
ListView {
id: iconSelectorView
width: parent.width
- height: width*0.2
+ height: root.height*0.2
orientation: ListView.Horizontal
model: iconModel
delegate: Asteroid.IconButton {
@@ -79,12 +74,23 @@ Item {
}
}
}
- Asteroid.IconButton {
- width: parent.width*0.2
- height: width
- iconName: "ios-checkmark-circle-outline"
- anchors.horizontalCenter: parent.horizontalCenter
- onClicked: appendWayPoint()
+ Row {
+ height: root.width*0.2
+ width: parent.width
+ Asteroid.IconButton {
+ height: parent.height
+ width: height
+ iconName: "ios-checkmark-circle-outline"
+ anchors.horizontalCenter: parent.horizontalCenter
+ onClicked: appendWayPoint()
+ }
+ Asteroid.IconButton {
+ height: parent.height
+ width: height
+ iconName: "ios-trash-circle"
+ anchors.horizontalCenter: parent.horizontalCenter
+ onClicked: removeWaypoint()
+ }
}
Item { width: parent.width ; height: root.width*0.2 }
}