feat: Additional marker for user message in chat

This commit is contained in:
Petr Mironychev 2025-02-24 16:54:45 +01:00
parent e924029ec2
commit 912c3d8c04
2 changed files with 17 additions and 3 deletions

View File

@ -27,14 +27,18 @@ Rectangle {
property alias msgModel: msgCreator.model property alias msgModel: msgCreator.model
property alias messageAttachments: attachmentsModel.model property alias messageAttachments: attachmentsModel.model
property bool isUserMessage: false
height: msgColumn.implicitHeight + 10 height: msgColumn.implicitHeight + 10
radius: 8 radius: 8
color: isUserMessage ? palette.alternateBase
: palette.base
ColumnLayout { ColumnLayout {
id: msgColumn id: msgColumn
width: parent.width x: 5
width: parent.width - x
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
spacing: 5 spacing: 5
@ -113,6 +117,17 @@ Rectangle {
} }
} }
Rectangle {
id: userMessageMarker
anchors.verticalCenter: parent.verticalCenter
width: 3
height: parent.height - 8
color: "#92BD6C"
radius: 8
visible: root.isUserMessage
}
component TextComponent : TextBlock { component TextComponent : TextBlock {
required property var itemData required property var itemData
height: implicitHeight + 10 height: implicitHeight + 10

View File

@ -96,8 +96,7 @@ ChatRootView {
width: ListView.view.width - scroll.width width: ListView.view.width - scroll.width
msgModel: root.chatModel.processMessageContent(model.content) msgModel: root.chatModel.processMessageContent(model.content)
messageAttachments: model.attachments messageAttachments: model.attachments
color: model.roleType === ChatModel.User ? palette.alternateBase isUserMessage: model.roleType === ChatModel.User
: palette.base
} }
header: Item { header: Item {