mobile/UI: move dive delete to context menu

Having this as the right action button (same one used for 'cancel' in
the edit screen) made it too likely to inadvertantly delete a dive. And
outside of testing, wanting to delete a dive really shouldn't be all
that common an operation. So remove the function from the action button
and place it into the context menu instead, right next to the undo
action so the user also is aware that there is an undo option.

Suggested-by: Peter Zaal <peter.zaal@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2021-01-17 11:29:22 -08:00
parent 1913e97bf2
commit 0a632e12d2

View file

@ -115,7 +115,7 @@ Kirigami.Page {
enabled: manager.redoText !== ""
onTriggered: manager.redo()
}
property variant contextactions: [ removeDiveFromTripAction, addDiveToTripAboveAction, addDiveToTripBelowAction, undoAction, redoAction ]
property variant contextactions: [ removeDiveFromTripAction, addDiveToTripAboveAction, addDiveToTripBelowAction, deleteAction, undoAction, redoAction ]
states: [
State {
@ -123,7 +123,7 @@ Kirigami.Page {
PropertyChanges {
target: diveDetailsPage;
actions {
right: deleteAction
right: null
left: currentItem ? (currentItem.modelData && currentItem.modelData.gps !== "" ? mapAction : null) : null
}
contextualActions: contextactions