diff --git a/retroshare-qml-app/src/ChatView.qml b/retroshare-qml-app/src/ChatView.qml index 4f0ea0fde..4df845024 100644 --- a/retroshare-qml-app/src/ChatView.qml +++ b/retroshare-qml-app/src/ChatView.qml @@ -22,10 +22,12 @@ import QtQuick.Layouts 1.2 import org.retroshare.qml_components.LibresapiLocalClient 1.0 import "." //Needed for TokensManager singleton import "./components" + Item { id: chatView property string chatId + property var gxsInfo: "" property int token: 0 property string objectName:"chatView" @@ -55,11 +57,32 @@ Item Component.onCompleted: { refreshData() toolBar.state = "CHATVIEW" - var gxs = ChatCache.lastMessageCache.getGxsFromChatId(chatView.chatId) - toolBar.titleText = gxs.name + gxsInfo= ChatCache.lastMessageCache.getGxsFromChatId(chatView.chatId) + toolBar.titleText = gxsInfo.name + toolBar.loaderSource = userHash } onFocusChanged: focus && refreshData() + Component { + id: userHash + + ColorHash + { + id: colorHash + + hash: gxsInfo.gxs + height: toolBar.height - 4 + anchors.leftMargin: 2 + + MouseArea + { + anchors.fill: parent + onClicked: delegateRoot.showDetails() + } + } + } + + JSONListModel { id: chatModel diff --git a/retroshare-qml-app/src/main-app.qml b/retroshare-qml-app/src/main-app.qml index f38bfc447..468da0ecd 100644 --- a/retroshare-qml-app/src/main-app.qml +++ b/retroshare-qml-app/src/main-app.qml @@ -58,31 +58,40 @@ ApplicationWindow { id: toolBar property alias titleText: toolBarText.text + property alias loaderSource: imageLoader.sourceComponent property string defaultLabel: "RetroShare" states: [ State { name: "DEFAULT" PropertyChanges { target: toolBar; titleText: defaultLabel} + PropertyChanges { target: toolBar; loaderSource: rsIcon} }, State { name: "CHATVIEW" } ] - Image - { - id: rsIcon - fillMode: Image.PreserveAspectFit - height: Math.max(30, parent.height - 4) + Loader { + id: imageLoader anchors.verticalCenter: parent.verticalCenter - source: "icons/retroshare06.png" + height: Math.max(30, toolBar.height - 4) } + + Component { + id: rsIcon + Image + { + fillMode: Image.PreserveAspectFit + source: "icons/retroshare06.png" + } + } + Label { id: toolBarText anchors.verticalCenter: parent.verticalCenter - anchors.left: rsIcon.right + anchors.left: imageLoader.right anchors.leftMargin: 20 } MouseArea