From 698f2fde901dd9accd7837448e910d0e2c91563d Mon Sep 17 00:00:00 2001 From: link2xt Date: Sat, 27 Feb 2021 00:44:25 +0300 Subject: Replace accounts page when account is selected Account management should be moved to an overlay or left panel, not available all the time as a first page. --- qml/AccountsPage.qml | 4 ++-- qml/ChatlistPage.qml | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/qml/AccountsPage.qml b/qml/AccountsPage.qml index a186989..b48a4e4 100644 --- a/qml/AccountsPage.qml +++ b/qml/AccountsPage.qml @@ -110,9 +110,9 @@ Kirigami.Page { dcAccounts.selectAccount(model.number) let context = dcAccounts.getSelectedAccount() if (context.isConfigured()) { - pageStack.push("qrc:/qml/ChatlistPage.qml", {context: context}) + pageStack.replace("qrc:/qml/ChatlistPage.qml", {context: context}) } else { - pageStack.push("qrc:/qml/ConfigurePage.qml", {context: context}) + pageStack.replace("qrc:/qml/ConfigurePage.qml", {context: context}) } } } diff --git a/qml/ChatlistPage.qml b/qml/ChatlistPage.qml index c77bbba..ce81602 100644 --- a/qml/ChatlistPage.qml +++ b/qml/ChatlistPage.qml @@ -97,10 +97,10 @@ Kirigami.Page { let chatPageComponent = Qt.createComponent("qrc:/qml/ChatPage.qml") if (chatPageComponent.status == Component.Ready) { let myPage = chatPageComponent.createObject(chatlistPage, {chatId: chatId}) - if (pageStack.depth == 2) { + if (pageStack.depth == 1) { pageStack.push(myPage) - } else if (pageStack.depth == 3) { - pageStack.currentIndex = 2 + } else if (pageStack.depth == 2) { + pageStack.currentIndex = 1 pageStack.replace(myPage) } } else if (chatPageComponent.status == Component.Error) { -- cgit v1.2.3-70-g09d2