From 9b2ce7538d28529f3c47e713779e4b0ae7b6aaf1 Mon Sep 17 00:00:00 2001 From: link2xt Date: Wed, 28 Jul 2021 10:41:54 +0300 Subject: Add New Chat page --- qml/ChatlistPage.qml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'qml/ChatlistPage.qml') diff --git a/qml/ChatlistPage.qml b/qml/ChatlistPage.qml index 8348091..a0d171a 100644 --- a/qml/ChatlistPage.qml +++ b/qml/ChatlistPage.qml @@ -36,6 +36,20 @@ Kirigami.ScrollablePage { updateChatlist() } + mainAction: Kirigami.Action { + text: "New chat" + iconName: "list-add" + onTriggered: { + let newChatPageComponent = Qt.createComponent("qrc:/qml/NewChatPage.qml") + if (newChatPageComponent.status == Component.Ready) { + let newChatPage = newChatPageComponent.createObject(pageStack, {context: chatlistPage.context}) + pageStack.layers.push(newChatPage) + } else if (newChatPageComponent.status == Component.Error) { + console.log("Error loading new chat page: " + newChatPageComponent.errorString()) + } + } + } + contextualActions: [ Kirigami.Action { text: "Settings" -- cgit v1.2.3-54-g00ecf