From 80cc1b4520c5d5b0a018276427e232d6e2fe6f9d Mon Sep 17 00:00:00 2001 From: Angela Mazzurco Date: Tue, 4 Jul 2017 15:51:03 +0200 Subject: [PATCH] Call toolbar change state when pop stackview --- retroshare-qml-app/src/ChatView.qml | 6 +++++- retroshare-qml-app/src/Contacts.qml | 8 ++++++-- retroshare-qml-app/src/main-app.qml | 12 +++++------- 3 files changed, 16 insertions(+), 10 deletions(-) diff --git a/retroshare-qml-app/src/ChatView.qml b/retroshare-qml-app/src/ChatView.qml index 5e14e82c3..484e670f8 100644 --- a/retroshare-qml-app/src/ChatView.qml +++ b/retroshare-qml-app/src/ChatView.qml @@ -58,12 +58,16 @@ Item Component.onCompleted: { refreshData() + } + onFocusChanged: focus && refreshData() + + function changeState () + { toolBar.state = "CHATVIEW" gxsInfo= ChatCache.lastMessageCache.getGxsFromChatId(chatView.chatId) toolBar.titleText = gxsInfo.name toolBar.loaderSource = userHash } - onFocusChanged: focus && refreshData() Component { diff --git a/retroshare-qml-app/src/Contacts.qml b/retroshare-qml-app/src/Contacts.qml index b4357a90e..415c33eb8 100644 --- a/retroshare-qml-app/src/Contacts.qml +++ b/retroshare-qml-app/src/Contacts.qml @@ -34,12 +34,16 @@ Item Component.onCompleted: { - toolBar.state = "CONTACTSVIEW" - toolBar.searchBtnCb = toggleSearchBox refreshAll() } onFocusChanged: focus && refreshAll() + function changeState () + { + toolBar.state = "CONTACTSVIEW" + toolBar.searchBtnCb = toggleSearchBox + } + WorkerScript { id: contactsSortWorker diff --git a/retroshare-qml-app/src/main-app.qml b/retroshare-qml-app/src/main-app.qml index 60d0a62b7..daa61504e 100644 --- a/retroshare-qml-app/src/main-app.qml +++ b/retroshare-qml-app/src/main-app.qml @@ -221,17 +221,15 @@ ApplicationWindow { toolBar.state = "DEFAULT" } + else if (typeof currentItem.changeState === 'function') + { + currentItem.changeState () + } + currentItem.focus = true } } - Keys.onReleased: - if (event.key === Qt.Key_Back && stackView.depth > 1) - { - stackView.pop(); - event.accepted = true; - } - state: "core_down" initialItem: BusyOverlay { message: qsTr("Connecting to core...") }