summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2020-02-18 16:12:12 -0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2020-03-10 09:25:57 -0700
commit56db02a6850baa8866edc8149fdad05f82d02df9 (patch)
tree1841d6963780d9391adbc550063aa87231111654
parentef2f65fd2722a242bc78bfe6ebbadb7364b54c81 (diff)
downloadsubsurface-56db02a6850baa8866edc8149fdad05f82d02df9.tar.gz
mobile UI: only show context menu when viewing a dive
In add and edit mode this is confusing and wrong. There is a bug in Kirigami that creates lots of bogus error message about missing mainFlickable. That needs to be patched out. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r--mobile-widgets/qml/DiveDetails.qml31
1 files changed, 17 insertions, 14 deletions
diff --git a/mobile-widgets/qml/DiveDetails.qml b/mobile-widgets/qml/DiveDetails.qml
index 46e9952a2..44c64042e 100644
--- a/mobile-widgets/qml/DiveDetails.qml
+++ b/mobile-widgets/qml/DiveDetails.qml
@@ -59,6 +59,20 @@ Kirigami.Page {
background: Rectangle { color: subsurfaceTheme.backgroundColor }
width: rootItem.colWidth
+ property QtObject removeDiveFromTripAction: Kirigami.Action { text: qsTr ("Remove dive from trip <TBD>") }
+ property QtObject addDiveToTripAction: Kirigami.Action { text: qsTr ("Add dive to trip <TBD>") }
+ property QtObject undoAction: Kirigami.Action {
+ text: qsTr("Undo") + " " + manager.undoText
+ enabled: manager.undoText !== ""
+ onTriggered: manager.undo()
+ }
+ property QtObject redoAction: Kirigami.Action {
+ text: qsTr("Redo") + " " + manager.redoText
+ enabled: manager.redoText !== ""
+ onTriggered: manager.redo()
+ }
+ property variant contextactions: [ removeDiveFromTripAction, addDiveToTripAction, undoAction, redoAction ]
+
states: [
State {
name: "view"
@@ -68,6 +82,7 @@ Kirigami.Page {
right: deleteAction
left: currentItem ? (currentItem.modelData && currentItem.modelData.gps !== "" ? mapAction : null) : null
}
+ contextualActions: contextactions
}
},
State {
@@ -78,6 +93,7 @@ Kirigami.Page {
right: cancelAction
left: null
}
+ contextualActions: []
}
},
State {
@@ -88,6 +104,7 @@ Kirigami.Page {
right: cancelAction
left: null
}
+ contextualActions: []
}
}
]
@@ -191,20 +208,6 @@ Kirigami.Page {
}
}
- contextualActions: [
- Kirigami.Action {
- text: qsTr("Undo") + " " + manager.undoText
- enabled: manager.undoText !== ""
- onTriggered: manager.undo()
- },
- Kirigami.Action {
- text: qsTr("Redo") + " " + manager.redoText
- enabled: manager.redoText !== ""
- onTriggered: manager.redo()
- }
- ]
-
-
onBackRequested: {
if (state === "edit") {
endEditMode()