diff options
Diffstat (limited to 'mobile-widgets/qml/DiveDetails.qml')
-rw-r--r-- | mobile-widgets/qml/DiveDetails.qml | 32 |
1 files changed, 7 insertions, 25 deletions
diff --git a/mobile-widgets/qml/DiveDetails.qml b/mobile-widgets/qml/DiveDetails.qml index 31fe8ce8d..2de542b6e 100644 --- a/mobile-widgets/qml/DiveDetails.qml +++ b/mobile-widgets/qml/DiveDetails.qml @@ -38,17 +38,20 @@ Kirigami.Page { states: [ State { name: "view" - PropertyChanges { target: diveDetailsPage; contextualActions: Qt.platform.os == "ios" ? [ deleteAction, backAction ] : [ deleteAction ] } + PropertyChanges { + target: diveDetailsPage; + actions { + right: deleteAction + } + } PropertyChanges { target: detailsEditScroll; opened: false } }, State { name: "edit" - PropertyChanges { target: diveDetailsPage; contextualActions: Qt.platform.os == "ios" ? [ cancelAction ] : null } PropertyChanges { target: detailsEditScroll; opened: true } }, State { name: "add" - PropertyChanges { target: diveDetailsPage; contextualActions: Qt.platform.os == "ios" ? [ cancelAction ] : null } PropertyChanges { target: detailsEditScroll; opened: true } } @@ -70,28 +73,7 @@ Kirigami.Page { } } - property QtObject cancelAction: Kirigami.Action { - text: state === "edit" ? "Cancel edit" : "Cancel dive add" - iconName: "dialog-cancel" - onTriggered: { - contextDrawer.close() - if (state === "add") - returnTopPage() - else - endEditMode() - } - } - - property QtObject backAction: Action { - text: "Back to dive list" - iconName: "go-previous" - onTriggered: { - contextDrawer.close() - returnTopPage() - } - } - - mainAction: Action { + actions.main: Action { iconName: state !== "view" ? "document-save" : "document-edit" onTriggered: { if (state === "edit" || state === "add") { |