From 611c4bb088f856355e5c038e5c533af544b7f02a Mon Sep 17 00:00:00 2001 From: jan Iversen Date: Fri, 20 Dec 2019 08:16:52 +0100 Subject: mobile UI/login: move startpage to main StartPage does not belong in divelist. Remove startPage from diveList and anchor in main. Make needed functional changes. Signed-off-by: Jan Iversen Signed-off-by: Dirk Hohndel --- mobile-widgets/qml/main.qml | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) (limited to 'mobile-widgets/qml/main.qml') diff --git a/mobile-widgets/qml/main.qml b/mobile-widgets/qml/main.qml index b20ce4262..b8ef213fb 100644 --- a/mobile-widgets/qml/main.qml +++ b/mobile-widgets/qml/main.qml @@ -708,8 +708,6 @@ if you have network connectivity and want to sync your data to cloud storage."), } } - pageStack.initialPage: diveList - property int hackToOpenMap: 0 /* Otherpage */ /* I really want an enum, but those are painful in QML, so let's use numbers * 0 (Otherpage) - the last page selected was a non-map page @@ -774,6 +772,31 @@ if you have network connectivity and want to sync your data to cloud storage."), id: manager } + StartPage { + id: startPage + anchors.fill: parent + visible: prefs.credentialStatus !== CloudStatus.CS_NOCLOUD && + prefs.credentialStatus !== CloudStatus.CS_VERIFIED + Behavior on opacity { NumberAnimation { duration: Kirigami.Units.shortDuration } } + + onVisibleChanged: { + console.log("---> Startpage changed visibility to " + visible) + if (visible) { + pageStack.clear() + diveList.visible = false + } else { + pageStack.push(diveList) + } + } + + Component.onCompleted: { + if (!visible) { + console.log("---> Startpage change to diveList") + pageStack.initPage = diveList + } + } + } + DiveList { id: diveList visible: false -- cgit v1.2.3-70-g09d2