diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2020-02-21 10:35:44 -0800 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2020-03-10 09:25:57 -0700 |
commit | 476ecb8d72e0441bdb1b3c657b84f0006b7b483d (patch) | |
tree | fac66267e0d7a75db5015839d76e4fdc4498246d /mobile-widgets/qml/DiveList.qml | |
parent | 7fc43c58bee8212217e2c0ba9c9dcc15b56171d4 (diff) | |
download | subsurface-476ecb8d72e0441bdb1b3c657b84f0006b7b483d.tar.gz |
mobile UI: more context actions in dive list
This adds the ability to delete a dive and to show its location on the map
directly from the dive list.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'mobile-widgets/qml/DiveList.qml')
-rw-r--r-- | mobile-widgets/qml/DiveList.qml | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/mobile-widgets/qml/DiveList.qml b/mobile-widgets/qml/DiveList.qml index f09609a73..7969412d6 100644 --- a/mobile-widgets/qml/DiveList.qml +++ b/mobile-widgets/qml/DiveList.qml @@ -274,6 +274,20 @@ Kirigami.ScrollablePage { manager.addDiveToTrip(currentItem.myData.id, currentItem.myData.tripBelow) } } + property QtObject deleteAction: Kirigami.Action { + text: qsTr("Delete dive") + icon { name: ":/icons/trash-empty.svg" } + onTriggered: manager.deleteDive(currentItem.myData.id) + } + property QtObject mapAction: Kirigami.Action { + text: qsTr("Show on map") + icon { name: ":/icons/gps" } + visible: currentItem && currentItem.myData && currentItem.myData.gps !== "" + onTriggered: { + showMap() + mapPage.centerOnDiveSite(currentItem.myData.diveSite) + } + } property QtObject undoAction: Kirigami.Action { text: qsTr("Undo") + " " + manager.undoText enabled: manager.undoText !== "" @@ -284,8 +298,7 @@ Kirigami.ScrollablePage { enabled: manager.redoText !== "" onTriggered: manager.redo() } - property variant contextactions: [ removeDiveFromTripAction, addDiveToTripAboveAction, addDiveToTripBelowAction, undoAction, redoAction ] - + property variant contextactions: [ removeDiveFromTripAction, addDiveToTripAboveAction, addDiveToTripBelowAction, deleteAction, mapAction, undoAction, redoAction ] StartPage { id: startPage anchors.fill: parent |