diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2016-02-13 21:25:10 -0800 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2016-02-13 21:25:10 -0800 |
commit | 0ce1dd80cc4752764e54b2a64e8bc9641b297239 (patch) | |
tree | 4beedb013c80c76d18df32a952ecc65d77dd9891 /qt-mobile/qml/DiveDetails.qml | |
parent | 5952b09b51b84fa1367a8013e1d5df4cb46e2c5d (diff) | |
download | subsurface-0ce1dd80cc4752764e54b2a64e8bc9641b297239.tar.gz |
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>
Diffstat (limited to 'qt-mobile/qml/DiveDetails.qml')
-rw-r--r-- | qt-mobile/qml/DiveDetails.qml | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/qt-mobile/qml/DiveDetails.qml b/qt-mobile/qml/DiveDetails.qml index c906ba268..a8db2990c 100644 --- a/qt-mobile/qml/DiveDetails.qml +++ b/qt-mobile/qml/DiveDetails.qml @@ -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) { |