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 { diff --git a/qt-mobile/qml/main.qml b/qt-mobile/qml/main.qml index 3e2700149..5f516a350 100644 --- a/qt-mobile/qml/main.qml +++ b/qt-mobile/qml/main.qml @@ -61,13 +61,6 @@ MobileComponents.ApplicationWindow { } }, - Action { - text: "Save Changes" - onTriggered: { - manager.saveChanges(); - } - }, - MobileComponents.ActionGroup { text: "GPS" Action { @@ -146,6 +139,12 @@ MobileComponents.ApplicationWindow { } } + contextDrawer: MobileComponents.ContextDrawer { + id: contextDrawer + actions: rootItem.pageStack.currentPage ? rootItem.pageStack.currentPage.contextualActions : null + title: "Actions" + } + QtObject { id: subsurfaceTheme property int titlePointSize: Math.round(fontMetrics.font.pointSize * 1.5) @@ -200,7 +199,6 @@ MobileComponents.ApplicationWindow { } Component.onCompleted: { - print("MobileComponents.Units.gridUnit is: " + MobileComponents.Units.gridUnit); manager.finishSetup(); } }