Cleanup the list of required properties for MessageDelegateContextMenu

This commit is contained in:
James Graham
2023-05-29 15:03:34 +00:00
parent 4e40f5c7d9
commit d09cd5d71b
5 changed files with 7 additions and 30 deletions

View File

@@ -78,13 +78,12 @@ Components.AlbumMaximizeComponent {
onItemRightClicked: {
const contextMenu = fileDelegateContextMenu.createObject(parent, {
author: root.author,
message: root.plainText,
eventId: root.eventId,
source: root.source,
file: parent,
mimeType: root.mimeType,
progressInfo: root.progressInfo,
plainMessage: root.plainText,
plainText: root.plainText,
});
contextMenu.closeFullscreen.connect(root.close)
contextMenu.open();

View File

@@ -79,11 +79,6 @@ ColumnLayout {
*/
required property string plainText
/**
* @brief The formatted body of the message.
*/
required property string formattedBody
/**
* @brief The date of the event as a string.
*/
@@ -600,13 +595,12 @@ ColumnLayout {
function openFileContext(file) {
const contextMenu = fileDelegateContextMenu.createObject(root, {
author: root.author,
message: root.plainText,
eventId: root.eventId,
source: root.source,
file: file,
mimeType: root.mimeType,
progressInfo: root.progressInfo,
plainMessage: root.plainText,
plainText: root.plainText,
});
contextMenu.open();
}
@@ -616,12 +610,10 @@ ColumnLayout {
const contextMenu = messageDelegateContextMenu.createObject(root, {
selectedText: selectedText,
author: root.author,
message: root.plainText,
eventId: root.eventId,
formattedBody: root.formattedBody,
source: root.source,
eventType: root.delegateType,
plainMessage: root.plainText,
plainText: root.plainText,
});
contextMenu.open();
}

View File

@@ -13,13 +13,11 @@ Loader {
id: loadRoot
required property var author
required property string message
required property string eventId
property var eventType
property string formattedBody: ""
required property string source
property string selectedText: ""
required property string plainMessage
required property string plainText
property list<Kirigami.Action> nestedActions
@@ -54,7 +52,7 @@ Loader {
Kirigami.Action {
text: i18n("Copy")
icon.name: "edit-copy"
onTriggered: Clipboard.saveText(loadRoot.selectedText === "" ? loadRoot.plainMessage : loadRoot.selectedText)
onTriggered: Clipboard.saveText(loadRoot.selectedText === "" ? loadRoot.plainText : loadRoot.selectedText)
},
Kirigami.Action {
text: i18nc("@action:button 'Report' as in 'Report this event to the administrators'", "Report")
@@ -136,7 +134,7 @@ Loader {
Instantiator {
model: WebShortcutModel {
id: webshortcutmodel
selectedText: loadRoot.selectedText ? loadRoot.selectedText : loadRoot.plainMessage
selectedText: loadRoot.selectedText ? loadRoot.selectedText : loadRoot.plainText
onOpenUrl: RoomManager.visitNonMatrix(url)
}
delegate: QQC2.MenuItem {
@@ -240,7 +238,7 @@ Loader {
wrapMode: Text.WordWrap
}
QQC2.Label {
text: message
text: plainText
Layout.fillWidth: true
wrapMode: Text.WordWrap