mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-30 22:20:21 +00:00
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>
This commit is contained in:
parent
11810d5d06
commit
611c4bb088
3 changed files with 26 additions and 26 deletions
|
@ -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
|
||||
|
|
|
@ -7,7 +7,6 @@ import org.subsurfacedivelog.mobile 1.0
|
|||
|
||||
|
||||
Kirigami.ScrollablePage {
|
||||
id: startpage
|
||||
background: Rectangle { color: subsurfaceTheme.backgroundColor }
|
||||
|
||||
ColumnLayout {
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue