mirror of
https://github.com/subsurface/subsurface.git
synced 2025-01-31 19:03:23 +00:00
main.qml: handle mapPage in pageStack.onCurrentItemChanged()
When the slot pageStack.onCurrentItemChanged() is reached make sure that the stackView becomes non-interactive. This prevents swiping left on the map to "go back". Also, always reload the map markers when the map becomes visible. This is not optimal and instead something in the lines of: DiveList.model.onChanged() is a much better solution. Ideally the map reload should happen on dive removal, dive addition, dive edits and sync from cloud. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
This commit is contained in:
parent
fe9c3d4c95
commit
49f566d6d8
1 changed files with 8 additions and 0 deletions
|
@ -476,6 +476,14 @@ if you have network connectivity and want to sync your data to cloud storage."),
|
|||
pageStack.onCurrentItemChanged: {
|
||||
// This is called whenever the user navigates using the breadcrumbs in the header
|
||||
|
||||
// disable the left swipe to go back when on the map page
|
||||
stackView.interactive = pageStack.currentItem.objectName !== mapPage.objectName
|
||||
|
||||
// is there a better way to reload the map markers instead of doing that
|
||||
// every time the map page is shown - e.g. link to the dive list model somehow?
|
||||
if (pageStack.currentItem.objectName === mapPage.objectName)
|
||||
mapPage.reloadMap()
|
||||
|
||||
// In case we land on any page, not being the DiveDetails (which can be
|
||||
// in multiple states, such as add, edit or view), just end the edit/add mode
|
||||
if (pageStack.currentItem.objectName !== "DiveDetails" &&
|
||||
|
|
Loading…
Add table
Reference in a new issue