From 49eb7d841da908f762d4e44ccfcd100648a11866 Mon Sep 17 00:00:00 2001 From: Sebastian Kügler Date: Fri, 4 Dec 2015 03:32:52 +0100 Subject: add a contextdrawer MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This item can be dragged in from the right hand side and provides contextual actions for a page. It will be used in the dive details edit. If there are actions, the floating button on the bottom shows an arrow indicating that one can drag it in from the right hand side to the left. Also clean up a bit of a noisy print that's not needed anymore. Signed-off-by: Sebastian Kügler --- qt-mobile/qml/DiveDetails.qml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'qt-mobile/qml/DiveDetails.qml') diff --git a/qt-mobile/qml/DiveDetails.qml b/qt-mobile/qml/DiveDetails.qml index 28646fd89..f60d39acb 100644 --- a/qt-mobile/qml/DiveDetails.qml +++ b/qt-mobile/qml/DiveDetails.qml @@ -43,6 +43,26 @@ MobileComponents.Page { } ] + contextualActions: [ + Action { + text: "Save Changes" + enabled: diveDetailsWindow.state == "edit" + iconName: "document-save" + onTriggered: { + manager.saveChanges(); + } + }, + Action { + text: checked ? "View" : "Edit" + checkable: true + iconName: checked ? "view-readermode" : "document-edit" + onTriggered: { + diveDetailsWindow.state = checked ? "edit" : "view" + } + } + + ] + ScrollView { anchors.fill: parent Flickable { -- cgit v1.2.3-70-g09d2