diff options
author | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2019-05-02 00:09:59 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2019-05-11 12:06:19 -0700 |
commit | a35d1bd0e79e83b5ef49b76087e7cfe5a38d829c (patch) | |
tree | dcacd763679c0fe2c9ce267f3c21dadc9c99393f /map-widget | |
parent | 446dfed6e72971ed91df9378bd5b7b34c90b690a (diff) | |
download | subsurface-a35d1bd0e79e83b5ef49b76087e7cfe5a38d829c.tar.gz |
Map: show multiple selected dive sites
If multiple dives are selected, highlight all corresponding sites.
For that, replace the MapLocationModel::m_selectedDs pointer by
a QVector<>. Fill the vector in MapLocationModel::reload() and
add a isSelected() member function.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'map-widget')
-rw-r--r-- | map-widget/qml/MapWidget.qml | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/map-widget/qml/MapWidget.qml b/map-widget/qml/MapWidget.qml index 77fd2141c..88e9d95a6 100644 --- a/map-widget/qml/MapWidget.qml +++ b/map-widget/qml/MapWidget.qml @@ -56,17 +56,17 @@ Item { anchorPoint.x: 0 anchorPoint.y: mapItemImage.height coordinate: model.coordinate - z: mapHelper.model.selectedDs === model.divesite ? mapHelper.model.count - 1 : 0 + z: mapHelper.model.isSelected(model.divesite) ? mapHelper.model.count - 1 : 0 sourceItem: Image { id: mapItemImage - source: "qrc:///dive-location-marker" + (mapHelper.model.selectedDs === model.divesite ? "-selected" : (mapHelper.editMode ? "-inactive" : "")) + "-icon" + source: "qrc:///dive-location-marker" + (mapHelper.model.isSelected(model.divesite) ? "-selected" : (mapHelper.editMode ? "-inactive" : "")) + "-icon" SequentialAnimation { id: mapItemImageAnimation PropertyAnimation { target: mapItemImage; property: "scale"; from: 1.0; to: 0.7; duration: 120 } PropertyAnimation { target: mapItemImage; property: "scale"; from: 0.7; to: 1.0; duration: 80 } } MouseArea { - drag.target: (mapHelper.editMode && mapHelper.model.selectedDs === model.divesite) ? mapItem : undefined + drag.target: (mapHelper.editMode && mapHelper.model.isSelected(model.divesite)) ? mapItem : undefined anchors.fill: parent onClicked: { if (!mapHelper.editMode) @@ -74,8 +74,8 @@ Item { } onDoubleClicked: map.doubleClickHandler(mapItem.coordinate) onReleased: { - if (mapHelper.editMode && mapHelper.model.selectedDs === model.divesite) { - mapHelper.updateCurrentDiveSiteCoordinatesFromMap(mapHelper.model.selectedDs, mapItem.coordinate) + if (mapHelper.editMode && mapHelper.model.isSelected(model.divesite)) { + mapHelper.updateCurrentDiveSiteCoordinatesFromMap(model.divesite, mapItem.coordinate) } } } @@ -94,7 +94,7 @@ Item { id: mapItemText text: model.name font.pointSize: 11.0 - color: mapHelper.model.selectedDs === model.divesite ? "white" : "lightgrey" + color: mapHelper.model.isSelected(model.divesite) ? "white" : "lightgrey" } } } |