Spectral/qml/menu/MessageContextMenu.qml

39 lines
1003 B
QML
Raw Normal View History

2018-08-07 15:41:18 +00:00
import QtQuick 2.9
import QtQuick.Controls 2.2
Menu {
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()
onClosed: messageContextMenu.destroy()
2018-08-07 15:41:18 +00:00
}