aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2019-10-07 22:38:20 -0500
committerGravatar Dirk Hohndel <dirk@hohndel.org>2019-10-13 11:32:27 -0700
commitfda10b8baada4182287e46278aa4bc000313be50 (patch)
tree200ef420d6ea7d818524f48f7f51ec2a1a969927
parent9a73be92077614e290a4ce08d237112e5a22b6b1 (diff)
downloadsubsurface-fda10b8baada4182287e46278aa4bc000313be50.tar.gz
Mobile: update the map when the selected dive changes
Now we see the highlighted dive flag match the dive selected in the dive list. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r--mobile-widgets/qml/DiveDetails.qml8
1 files changed, 8 insertions, 0 deletions
diff --git a/mobile-widgets/qml/DiveDetails.qml b/mobile-widgets/qml/DiveDetails.qml
index a4821ce62..6fed1355e 100644
--- a/mobile-widgets/qml/DiveDetails.qml
+++ b/mobile-widgets/qml/DiveDetails.qml
@@ -214,7 +214,15 @@ Kirigami.Page {
}
onCurrentItemChanged: {
+ // why do we do this? What consumes this?
manager.selectedDiveTimestamp = currentItem.modelData.dive.timestamp
+ // make sure the core data structures reflect that this dive is selected
+ manager.selectDive(currentItem.modelData.dive.id)
+ // update the map to show the highlighted flag and center on it
+ if (rootItem.pageIndex(mapPage) !== -1) {
+ mapPage.reloadMap()
+ mapPage.centerOnDiveSite(currentItem.modelData.dive.dive_site)
+ }
}
function showDiveIndex(index) {