aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorArseniy Movshev <dodoradio@outlook.com>2023-01-07 02:49:45 +0000
committerArseniy Movshev <dodoradio@outlook.com>2023-01-07 15:46:48 +0000
commitddff93dee672a3e78259a96f086017ff7b4fea75 (patch)
treecc78011eba141ab90fb60961ee6b466ad11bbdb7 /src
parent452a1a4d5784cfc191485f4e77133ef3090ee693 (diff)
add borders to waypoints and make them clickable
Diffstat (limited to 'src')
-rw-r--r--src/MainMapView.qml6
-rw-r--r--src/MapWaypoint.qml13
2 files changed, 15 insertions, 4 deletions
diff --git a/src/MainMapView.qml b/src/MainMapView.qml
index 00f0ef2..3254611 100644
--- a/src/MainMapView.qml
+++ b/src/MainMapView.qml
@@ -30,7 +30,10 @@ Item {
id: waypointSource
key: "/map/waypointList"
defaultValue: ""
- onValueChanged: mapView.updateWaypoints()
+ onValueChanged: {
+ mapView.updateWaypoints()
+ console.log("value changed")
+ }
Component.onCompleted: mapView.updateWaypoints()
}
@@ -66,6 +69,7 @@ Item {
}
property MapQuickItem mapItem
function updateWaypoints() {
+ console.log("waypoints updated")
var waypointsList = waypointSource.value.split(">")
for(var i = 0, size = waypointsList.length-1; i < size ; i++){
var currWaypointData = waypointsList[i].split(";")
diff --git a/src/MapWaypoint.qml b/src/MapWaypoint.qml
index 1300cb0..3a56dcc 100644
--- a/src/MapWaypoint.qml
+++ b/src/MapWaypoint.qml
@@ -11,10 +11,17 @@ MapQuickItem {
autoFadeIn: false
property string iconName
property color iconColor
- sourceItem: Asteroid.Icon {
+ sourceItem: Asteroid.IconButton {
width: Asteroid.Dims.w(12)
+ iconName: "waypoint"
height: width
- name: root.iconName
- color: root.iconColor
+ iconColor: root.iconColor.hsvValue < 0.5 ? "white" : "black"
+ Asteroid.Icon {
+ anchors.centerIn: parent
+ width: parent.width*0.9
+ height: width
+ name: root.iconName
+ color: root.iconColor
+ }
}
}