diff options
author | jan Iversen <jan@casacondor.com> | 2019-12-20 08:16:52 +0100 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2019-12-24 15:53:15 -0800 |
commit | 611c4bb088f856355e5c038e5c533af544b7f02a (patch) | |
tree | 190f1a8e8037dcb6a8fa186f16cd98a4ff876277 | |
parent | 11810d5d0677ea1845ac4272c8578010132a8e1e (diff) | |
download | subsurface-611c4bb088f856355e5c038e5c533af544b7f02a.tar.gz |
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 <jani@apache.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r-- | mobile-widgets/qml/DiveList.qml | 24 | ||||
-rw-r--r-- | mobile-widgets/qml/StartPage.qml | 1 | ||||
-rw-r--r-- | mobile-widgets/qml/main.qml | 27 |
3 files changed, 26 insertions, 26 deletions
diff --git a/mobile-widgets/qml/DiveList.qml b/mobile-widgets/qml/DiveList.qml index 52861443a..4fb38450d 100644 --- a/mobile-widgets/qml/DiveList.qml +++ b/mobile-widgets/qml/DiveList.qml @@ -42,8 +42,7 @@ Kirigami.ScrollablePage { } } } -// this will be: onVisibleChanged: { - function simulateVisibleChanged() { + onVisibleChanged: { console.log("---> DiveList changed visibility to " + visible) if (visible) { page.actions.main = page.downloadFromDCAction @@ -402,27 +401,6 @@ Kirigami.ScrollablePage { } } - StartPage { - id: startPage - anchors.fill: parent - opacity: (credentialStatus === CloudStatus.CS_NOCLOUD || - credentialStatus === CloudStatus.CS_VERIFIED) ? 0 : 1 - visible: opacity > 0 - Behavior on opacity { NumberAnimation { duration: Kirigami.Units.shortDuration } } - onVisibleChanged: { - console.log("---> Startpage changed visibility to " + visible) - if (visible) { - page.actions.main = null - page.actions.right = null - page.actions.left = null - page.title = qsTr("Cloud credentials") - } else { - // This is to be removed when StartPage becomes a proper page - page.simulateVisibleChanged() - } - } - } - Controls.Label { anchors.fill: parent horizontalAlignment: Text.AlignHCenter diff --git a/mobile-widgets/qml/StartPage.qml b/mobile-widgets/qml/StartPage.qml index 5b6a82bb0..1237208a9 100644 --- a/mobile-widgets/qml/StartPage.qml +++ b/mobile-widgets/qml/StartPage.qml @@ -7,7 +7,6 @@ import org.subsurfacedivelog.mobile 1.0 Kirigami.ScrollablePage { - id: startpage background: Rectangle { color: subsurfaceTheme.backgroundColor } ColumnLayout { 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 |