mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-17 20:16:16 +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: {
|
onVisibleChanged: {
|
||||||
function simulateVisibleChanged() {
|
|
||||||
console.log("---> DiveList changed visibility to " + visible)
|
console.log("---> DiveList changed visibility to " + visible)
|
||||||
if (visible) {
|
if (visible) {
|
||||||
page.actions.main = page.downloadFromDCAction
|
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 {
|
Controls.Label {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
horizontalAlignment: Text.AlignHCenter
|
horizontalAlignment: Text.AlignHCenter
|
||||||
|
|
|
@ -7,7 +7,6 @@ import org.subsurfacedivelog.mobile 1.0
|
||||||
|
|
||||||
|
|
||||||
Kirigami.ScrollablePage {
|
Kirigami.ScrollablePage {
|
||||||
id: startpage
|
|
||||||
background: Rectangle { color: subsurfaceTheme.backgroundColor }
|
background: Rectangle { color: subsurfaceTheme.backgroundColor }
|
||||||
|
|
||||||
ColumnLayout {
|
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 */
|
property int hackToOpenMap: 0 /* Otherpage */
|
||||||
/* I really want an enum, but those are painful in QML, so let's use numbers
|
/* 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
|
* 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
|
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 {
|
DiveList {
|
||||||
id: diveList
|
id: diveList
|
||||||
visible: false
|
visible: false
|
||||||
|
|
Loading…
Add table
Reference in a new issue