mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
QML UI: change the dive add/edit action button to be save
Remove the button on the page and instead use the action button to save and the back key to cancel. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
5952b09b51
commit
0ce1dd80cc
2 changed files with 33 additions and 34 deletions
|
@ -74,12 +74,10 @@ MobileComponents.Page {
|
|||
]
|
||||
*/
|
||||
mainAction: Action {
|
||||
iconName: state !== "view" ? "dialog-cancel" : "document-edit"
|
||||
iconName: state !== "view" ? "document-save" : "document-edit"
|
||||
onTriggered: {
|
||||
if (state === "edit") {
|
||||
endEditMode()
|
||||
} else if (state === "add") {
|
||||
endAddMode()
|
||||
if (state === "edit" || state === "add") {
|
||||
detailsEdit.saveData()
|
||||
} else {
|
||||
startEditMode()
|
||||
}
|
||||
|
@ -87,10 +85,14 @@ MobileComponents.Page {
|
|||
}
|
||||
|
||||
onBackRequested: {
|
||||
if (state === "edit" || state === "add") {
|
||||
endEditMode();
|
||||
if (state === "edit") {
|
||||
endEditMode()
|
||||
event.accepted = true;
|
||||
} else if (state === "add") {
|
||||
endAddMode()
|
||||
event.accepted = true;
|
||||
}
|
||||
// if we were in view mode, don't accept the event and pop the page
|
||||
}
|
||||
|
||||
function showDiveIndex(index) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue