mobile/dive-list: long press on dive selects and opens context drawer

This way one can execute dive list manipulations without the detour
to the dive details screen. For example you can long-press on a dive and then
add it to a trip or remove it from a trip.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2020-02-21 09:56:21 -08:00
parent 289d451294
commit 7fc43c58be

View file

@ -74,6 +74,18 @@ Kirigami.ScrollablePage {
}
}
}
// use this to select a dive without switching to dive details; instead open context drawer
onPressAndHold: {
view.currentIndex = index
if (isTrip) {
manager.appendTextToLog("press and hold on trip is same as click")
manager.toggle(model.row)
} else {
manager.appendTextToLog("press and hold on dive; open context drawer")
manager.selectRow(model.row)
contextDrawer.open()
}
}
// first we look at the trip
Item {