From c6dbbe1aacf4dc3c6b18b318428113a3d0050625 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Tue, 19 Apr 2016 04:51:19 -0700 Subject: QML UI: adapt for latest Kirigami In commit 50ebdd020e3c of the Kirigami project the syntax with which actions are added to pages has changed. This commit tracks that, adds the new file that was added in Kirigami and also removes the now obsolete context menus (since we have a working back button on iOS now) Signed-off-by: Dirk Hohndel --- mobile-widgets/qml/DiveDetails.qml | 32 +++++++------------------------- 1 file changed, 7 insertions(+), 25 deletions(-) (limited to 'mobile-widgets/qml/DiveDetails.qml') 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") { -- cgit v1.2.3-70-g09d2