Spectral/qml/menu/MessageContextMenu.qml

51 lines
1.1 KiB
QML
Raw Normal View History

2018-08-07 15:41:18 +00:00
import QtQuick 2.9
import QtQuick.Controls 2.2
Menu {
2018-09-11 05:14:56 +00:00
property var row
property bool canRedact
property string eventType
property string plainText
property string toolTip
property string eventId
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"
2018-09-04 13:13:14 +00:00
2018-08-07 15:41:18 +00:00
onTriggered: matriqueController.copyToClipboard(plainText)
}
MenuItem {
2018-09-11 05:14:56 +00:00
text: "View Source"
2018-09-04 13:13:14 +00:00
2018-09-11 05:14:56 +00:00
onTriggered: {
sourceDialog.sourceText = toolTip
sourceDialog.open()
}
2018-08-07 15:41:18 +00:00
}
MenuItem {
visible: isFile
height: visible ? undefined : 0
text: "Open Externally"
2018-09-04 13:13:14 +00:00
2018-09-11 05:14:56 +00:00
onTriggered: row.openExternally()
2018-08-07 15:41:18 +00:00
}
MenuItem {
visible: isFile
height: visible ? undefined : 0
text: "Save As"
2018-09-04 13:13:14 +00:00
2018-09-11 05:14:56 +00:00
onTriggered: row.saveFileAs()
2018-08-07 15:41:18 +00:00
}
MenuItem {
2018-09-11 05:14:56 +00:00
visible: canRedact
2018-08-07 15:41:18 +00:00
height: visible ? undefined : 0
text: "Redact"
2018-09-04 13:13:14 +00:00
2018-08-07 15:41:18 +00:00
onTriggered: currentRoom.redactEvent(eventId)
}
}