mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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>
This commit is contained in:
parent
7fc43c58be
commit
476ecb8d72
1 changed files with 15 additions and 2 deletions
|
@ -274,6 +274,20 @@ Kirigami.ScrollablePage {
|
||||||
manager.addDiveToTrip(currentItem.myData.id, currentItem.myData.tripBelow)
|
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 {
|
property QtObject undoAction: Kirigami.Action {
|
||||||
text: qsTr("Undo") + " " + manager.undoText
|
text: qsTr("Undo") + " " + manager.undoText
|
||||||
enabled: manager.undoText !== ""
|
enabled: manager.undoText !== ""
|
||||||
|
@ -284,8 +298,7 @@ Kirigami.ScrollablePage {
|
||||||
enabled: manager.redoText !== ""
|
enabled: manager.redoText !== ""
|
||||||
onTriggered: manager.redo()
|
onTriggered: manager.redo()
|
||||||
}
|
}
|
||||||
property variant contextactions: [ removeDiveFromTripAction, addDiveToTripAboveAction, addDiveToTripBelowAction, undoAction, redoAction ]
|
property variant contextactions: [ removeDiveFromTripAction, addDiveToTripAboveAction, addDiveToTripBelowAction, deleteAction, mapAction, undoAction, redoAction ]
|
||||||
|
|
||||||
StartPage {
|
StartPage {
|
||||||
id: startPage
|
id: startPage
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue