mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
QML UI: experimentally enable context menu on each page
This is necessary to allow all user interaction when removing action buttons from the top bar. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
a738174a45
commit
d9d1b58e6a
6 changed files with 83 additions and 4 deletions
|
@ -45,16 +45,40 @@ MobileComponents.Page {
|
|||
}
|
||||
|
||||
]
|
||||
|
||||
function endAddMode() {
|
||||
// edit was canceled - so remove the dive from the dive list
|
||||
manager.addDiveAborted(dive_id)
|
||||
state = "view"
|
||||
Qt.inputMethod.hide()
|
||||
}
|
||||
|
||||
contextualActions: [
|
||||
Action {
|
||||
text: state === "view" ? "Back to dive list" : "Cancel"
|
||||
iconName: "dialog-cancel"
|
||||
onTriggered: {
|
||||
if (state === "view") {
|
||||
stackView.pop()
|
||||
contextDrawer.close()
|
||||
} else if (state === "edit") {
|
||||
endEditMode()
|
||||
contextDrawer.close()
|
||||
} else {
|
||||
endAddMode()
|
||||
contextDrawer.close()
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
mainAction: Action {
|
||||
iconName: state !== "view" ? "dialog-cancel" : "document-edit"
|
||||
onTriggered: {
|
||||
if (state === "edit") {
|
||||
endEditMode()
|
||||
} else if (state === "add") {
|
||||
// edit was canceled - so remove the dive from the dive list
|
||||
manager.addDiveAborted(dive_id)
|
||||
state = "view"
|
||||
Qt.inputMethod.hide()
|
||||
endAddMode()
|
||||
} else {
|
||||
startEditMode()
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue