From 5952b09b51b84fa1367a8013e1d5df4cb46e2c5d Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Sat, 13 Feb 2016 21:09:33 -0800 Subject: QML UI: use action button and Android back button to save / go back This is more consistent with the rest of our UI To make this work you once again need changes to the mobile components that aren't upstream, yet. Signed-off-by: Dirk Hohndel --- qt-mobile/qml/DiveList.qml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'qt-mobile/qml/DiveList.qml') diff --git a/qt-mobile/qml/DiveList.qml b/qt-mobile/qml/DiveList.qml index 403cb6846..298680682 100644 --- a/qt-mobile/qml/DiveList.qml +++ b/qt-mobile/qml/DiveList.qml @@ -184,13 +184,37 @@ MobileComponents.Page { } } } + + property QtObject saveAction: Action { + iconName: "document-save" + onTriggered: { + startPage.saveCredentials(); + } + } + + onBackRequested: { + if (diveListView.count > 0 && manager.credentialStatus != QMLManager.INVALID) { + manager.credentialStatus = oldStatus + } + event.accepted = true; + } + ScrollView { id: startPageWrapper anchors.fill: parent opacity: (diveListView.count > 0 && (credentialStatus == QMLManager.VALID || credentialStatus == QMLManager.VALID_EMAIL)) ? 0 : 1 visible: opacity > 0 Behavior on opacity { NumberAnimation { duration: MobileComponents.Units.shortDuration } } + onVisibleChanged: { + if (visible) { + page.mainAction = page.saveAction + } else { + page.mainAction = null + } + } + StartPage { + id: startPage } } } -- cgit v1.2.3-70-g09d2