mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
mapwidget.qml: track the marker selection
Add a MouseArea to the MapItemView delagate and onClick set the "mapHelper.model.selectedUuid" to the uuid of the clicked marker. This updates the "selectedUuid" property inside MapLocationModel. Based on "mapHelper.model.selectedUuid" it is now possible to show two seprate images for selected / deselected markers. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
This commit is contained in:
parent
4b03216fdb
commit
f2608edc56
1 changed files with 11 additions and 1 deletions
|
@ -38,7 +38,17 @@ Item {
|
|||
anchorPoint.x: 0
|
||||
anchorPoint.y: mapItemImage.height
|
||||
coordinate: model.coordinate
|
||||
sourceItem: Image { id: mapItemImage; source: "qrc:///mapwidget-marker-image" }
|
||||
sourceItem: Image {
|
||||
id: mapItemImage;
|
||||
source: "qrc:///mapwidget-marker" + (mapHelper.model.selectedUuid === model.uuid ? "-selected" : "");
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
onClicked: {
|
||||
mapHelper.model.selectedUuid = model.uuid
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue