diff --git a/retroshare-qml-app/src/ChatBubbleDelegate.qml b/retroshare-qml-app/src/ChatBubbleDelegate.qml index 80650e07d..6b458ede6 100644 --- a/retroshare-qml-app/src/ChatBubbleDelegate.qml +++ b/retroshare-qml-app/src/ChatBubbleDelegate.qml @@ -94,6 +94,11 @@ Item { } + Component.onCompleted: { + toolBar.state = "CHATVIEW" + toolBar.titleText = model.author_name + } + function getMessageTime(){ var timeFormat = "hh:mm"; diff --git a/retroshare-qml-app/src/ChatView.qml b/retroshare-qml-app/src/ChatView.qml index 0794959ab..625ceb1c4 100644 --- a/retroshare-qml-app/src/ChatView.qml +++ b/retroshare-qml-app/src/ChatView.qml @@ -27,6 +27,8 @@ Item property string chatId property int token: 0 + property string objectName:"chatView" + function refreshData() { diff --git a/retroshare-qml-app/src/main-app.qml b/retroshare-qml-app/src/main-app.qml index 497119d69..033bf2088 100644 --- a/retroshare-qml-app/src/main-app.qml +++ b/retroshare-qml-app/src/main-app.qml @@ -57,6 +57,18 @@ ApplicationWindow header: ToolBar { id: toolBar + property alias titleText: toolBarText.text + property string defaultLabel: "RetroShare" + + states: [ + State { + name: "DEFAULT" + PropertyChanges { target: toolBar; titleText: defaultLabel} + }, + State { + name: "CHATVIEW" + } + ] Image { @@ -68,7 +80,8 @@ ApplicationWindow } Label { - text: "RetroShare" + id: toolBarText + text: defaultLabel anchors.verticalCenter: parent.verticalCenter anchors.left: rsIcon.right anchors.leftMargin: 20 @@ -135,7 +148,15 @@ ApplicationWindow id: stackView anchors.fill: parent focus: true - onCurrentItemChanged: if (currentItem) currentItem.focus = true + onCurrentItemChanged: { + if (currentItem) { + if (currentItem.objectName != "chatView" && toolBar.state != "DEFAULT"){ + toolBar.state = "DEFAULT" + } + currentItem.focus = true + } + } + Keys.onReleased: if (event.key === Qt.Key_Back && stackView.depth > 1) {