From 502e28ecd76c6f4299dfcec10f71e3b234aa4a5b Mon Sep 17 00:00:00 2001 From: link2xt Date: Sat, 27 Feb 2021 17:49:28 +0300 Subject: Switch to 2-page layout Account switching is an overlay now. --- qml.qrc | 1 + qml/AccountsPage.qml | 1 + qml/SplashPage.qml | 8 ++++++++ qml/main.qml | 9 ++++++++- 4 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 qml/SplashPage.qml diff --git a/qml.qrc b/qml.qrc index 476198c..d2bf225 100644 --- a/qml.qrc +++ b/qml.qrc @@ -1,6 +1,7 @@ qml/main.qml + qml/SplashPage.qml qml/AccountsPage.qml qml/ChatPage.qml qml/ChatlistPage.qml diff --git a/qml/AccountsPage.qml b/qml/AccountsPage.qml index b48a4e4..ce1df02 100644 --- a/qml/AccountsPage.qml +++ b/qml/AccountsPage.qml @@ -114,6 +114,7 @@ Kirigami.Page { } else { pageStack.replace("qrc:/qml/ConfigurePage.qml", {context: context}) } + pageStack.layers.pop() } } diff --git a/qml/SplashPage.qml b/qml/SplashPage.qml new file mode 100644 index 0000000..d3af1c9 --- /dev/null +++ b/qml/SplashPage.qml @@ -0,0 +1,8 @@ +import QtQuick 2.12 +import org.kde.kirigami 2.12 as Kirigami + +Kirigami.Page { + id: splashPage + + title: qsTr("Delta Chat") +} diff --git a/qml/main.qml b/qml/main.qml index 546d553..7b0601b 100644 --- a/qml/main.qml +++ b/qml/main.qml @@ -12,7 +12,9 @@ Kirigami.ApplicationWindow { title: qsTr("Delta Chat") - pageStack.initialPage: AccountsPage {} + Component {id: accountsPage; AccountsPage {}} + + pageStack.initialPage: SplashPage {} globalDrawer: Kirigami.GlobalDrawer { header: Controls.Switch { @@ -31,6 +33,11 @@ Kirigami.ApplicationWindow { text: "Maybe network" iconName: "view-refresh" onTriggered: dcAccounts.maybeNetwork() + }, + Kirigami.Action { + text: "Switch account" + iconName: "view-refresh" + onTriggered: pageStack.layers.push(accountsPage) } ] } -- cgit v1.2.3-70-g09d2