2018-08-07 15:41:18 +00:00
|
|
|
import QtQuick 2.9
|
|
|
|
import QtQuick.Controls 2.2
|
|
|
|
|
|
|
|
Menu {
|
2018-08-13 14:44:32 +00:00
|
|
|
readonly property bool isFile: eventType === "video" || eventType === "audio" || eventType === "file" || eventType === "image"
|
|
|
|
|
|
|
|
id: messageContextMenu
|
|
|
|
|
2018-08-07 15:41:18 +00:00
|
|
|
MenuItem {
|
|
|
|
text: "Copy"
|
|
|
|
onTriggered: matriqueController.copyToClipboard(plainText)
|
|
|
|
}
|
|
|
|
MenuItem {
|
|
|
|
text: "Copy Source"
|
|
|
|
onTriggered: matriqueController.copyToClipboard(toolTip)
|
|
|
|
}
|
|
|
|
MenuItem {
|
|
|
|
visible: isFile
|
|
|
|
height: visible ? undefined : 0
|
|
|
|
text: "Open Externally"
|
2018-09-04 06:58:41 +00:00
|
|
|
onTriggered: messageRow.openExternally()
|
2018-08-07 15:41:18 +00:00
|
|
|
}
|
|
|
|
MenuItem {
|
|
|
|
visible: isFile
|
|
|
|
height: visible ? undefined : 0
|
|
|
|
text: "Save As"
|
2018-09-04 06:58:41 +00:00
|
|
|
onTriggered: messageRow.saveFileAs()
|
2018-08-07 15:41:18 +00:00
|
|
|
}
|
|
|
|
MenuItem {
|
|
|
|
visible: sentByMe
|
|
|
|
height: visible ? undefined : 0
|
|
|
|
text: "Redact"
|
|
|
|
onTriggered: currentRoom.redactEvent(eventId)
|
|
|
|
}
|
|
|
|
|
|
|
|
Component.onCompleted: popup()
|
2018-08-13 14:44:32 +00:00
|
|
|
onClosed: messageContextMenu.destroy()
|
2018-08-07 15:41:18 +00:00
|
|
|
}
|