Make it so that the menus for individual thread messages can be accessed

This is mostly just for text type messages at the moment but give the framework so that when other message types can be sent in threads they can be added easily
This commit is contained in:
James Graham
2025-03-15 16:03:27 +00:00
parent 4a800f99e1
commit 24235174fd
11 changed files with 137 additions and 50 deletions

View File

@@ -12,6 +12,20 @@ import org.kde.neochat
QQC2.Control {
id: root
/**
* @brief The matrix ID of the message event.
*/
required property string eventId
/**
* @brief The message author.
*
* A Quotient::RoomMember object.
*
* @sa Quotient::RoomMember
*/
required property NeochatRoomMember author
/**
* @brief The display text of the message.
*/
@@ -22,11 +36,6 @@ QQC2.Control {
*/
signal selectedTextChanged(string selectedText)
/**
* @brief Request a context menu be show for the message.
*/
signal showMessageMenu
Layout.fillWidth: true
Layout.fillHeight: true
Layout.maximumWidth: Message.maxContentWidth
@@ -54,7 +63,7 @@ QQC2.Control {
enabled: !quoteText.hoveredLink
acceptedDevices: PointerDevice.TouchScreen
acceptedButtons: Qt.LeftButton
onLongPressed: root.showMessageMenu()
onLongPressed: RoomManager.viewEventMenu(root.eventId, root.Message.room, root.author, root.Message.selectedText, root.Message.hoveredLink);
}
}