Separate out a base MessageContentModel.

Separate out a base `MessageContentModel` that can be extended to get the component types from different places. This is used currently for `EventMessageContentModel` but will be used later as part of the rich chat bar.

All display text is now in the text component so it never needs special casing. This also cleans up some of the model parameters so more things come from attributes including location and file data (which was already a qvariantmap anyway).

Also cleaned up the itinerary and file enhancement views,
This commit is contained in:
James Graham
2025-08-01 12:15:51 +01:00
parent 501f14fead
commit b4e1740cad
24 changed files with 874 additions and 789 deletions

View File

@@ -24,20 +24,6 @@ import org.kde.neochat
RowLayout {
id: root
/**
* @brief The matrix ID of the reply event.
*/
required property var replyEventId
/**
* @brief The reply author.
*
* A Quotient::RoomMember object.
*
* @sa Quotient::RoomMember
*/
required property var replyAuthor
/**
* @brief The model to visualise the content of the message replied to.
*/
@@ -52,7 +38,7 @@ RowLayout {
Layout.fillHeight: true
implicitWidth: Kirigami.Units.smallSpacing
color: root.replyAuthor.color
color: root.replyContentModel.author.color
radius: Kirigami.Units.cornerRadius
}
ColumnLayout {
@@ -65,7 +51,7 @@ RowLayout {
id: contentRepeater
model: root.replyContentModel
delegate: ReplyMessageComponentChooser {
onReplyClicked: RoomManager.goToEvent(root.replyEventId)
onReplyClicked: RoomManager.goToEvent(root.replyContentModel.eventId)
}
}
}
@@ -74,7 +60,7 @@ RowLayout {
}
TapHandler {
acceptedButtons: Qt.LeftButton
onTapped: RoomManager.goToEvent(root.replyEventId)
onTapped: RoomManager.goToEvent(root.replyContentModel.eventId)
}
QtObject {
id: _private