mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Mobile: when selecting dive via map, expand its trip
Previously if the dive was in a different trip, we'd scroll to that trip but not expand the trip, which was a confusing user experience. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
6422079de5
commit
2ef401ef5f
1 changed files with 8 additions and 0 deletions
|
|
@ -49,6 +49,9 @@ Kirigami.ScrollablePage {
|
||||||
Kirigami.AbstractListItem {
|
Kirigami.AbstractListItem {
|
||||||
// this looks weird, but it's how we can tell that this dive isn't in a trip
|
// this looks weird, but it's how we can tell that this dive isn't in a trip
|
||||||
property bool diveOutsideTrip: tripNrDives === 0
|
property bool diveOutsideTrip: tripNrDives === 0
|
||||||
|
// this allows us to access properties of the currentItem from outside
|
||||||
|
property variant myData: model
|
||||||
|
|
||||||
leftPadding: 0
|
leftPadding: 0
|
||||||
topPadding: 0
|
topPadding: 0
|
||||||
id: innerListItem
|
id: innerListItem
|
||||||
|
|
@ -612,8 +615,13 @@ Kirigami.ScrollablePage {
|
||||||
}
|
}
|
||||||
|
|
||||||
function setCurrentDiveListIndex(idx, noScroll) {
|
function setCurrentDiveListIndex(idx, noScroll) {
|
||||||
|
// pick the dive in the dive list and make sure its trip is expanded
|
||||||
diveListView.currentIndex = idx
|
diveListView.currentIndex = idx
|
||||||
|
activeTrip = diveListView.currentItem.myData.tripId
|
||||||
|
|
||||||
|
// update the diveDetails page to also show that dive
|
||||||
detailsWindow.showDiveIndex(idx)
|
detailsWindow.showDiveIndex(idx)
|
||||||
|
|
||||||
// updating the index of the ListView triggers a non-linear scroll
|
// updating the index of the ListView triggers a non-linear scroll
|
||||||
// animation that can be very slow. the fix is to stop this animation
|
// animation that can be very slow. the fix is to stop this animation
|
||||||
// by setting contentY to itself and then using positionViewAtIndex().
|
// by setting contentY to itself and then using positionViewAtIndex().
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue