Start implementing bubbles
This commit is contained in:
@@ -5,50 +5,43 @@
|
||||
*/
|
||||
import QtQuick 2.12
|
||||
import QtQuick.Controls 2.12
|
||||
|
||||
import org.kde.kirigami 2.14 as Kirigami
|
||||
import NeoChat.Dialog 1.0
|
||||
import NeoChat.Menu 1.0
|
||||
|
||||
Menu {
|
||||
MessageDelegateContextMenu {
|
||||
id: root
|
||||
|
||||
required property var room
|
||||
required property var author
|
||||
|
||||
signal viewSource()
|
||||
signal downloadAndOpen()
|
||||
signal saveFileAs()
|
||||
signal reply()
|
||||
signal redact()
|
||||
|
||||
MenuItem {
|
||||
text: i18n("View Source")
|
||||
|
||||
onTriggered: viewSource()
|
||||
}
|
||||
|
||||
MenuItem {
|
||||
text: i18n("Open Externally")
|
||||
|
||||
onTriggered: downloadAndOpen()
|
||||
}
|
||||
|
||||
MenuItem {
|
||||
text: i18n("Save As")
|
||||
|
||||
onTriggered: saveFileAs()
|
||||
}
|
||||
|
||||
MenuItem {
|
||||
text: i18n("Reply")
|
||||
|
||||
onTriggered: reply()
|
||||
}
|
||||
|
||||
MenuItem {
|
||||
visible: room.canSendState("redact") || room.localUser.id === author.id
|
||||
text: i18n("Redact")
|
||||
onTriggered: redact()
|
||||
}
|
||||
|
||||
onClosed: destroy()
|
||||
property list<Kirigami.Action> actions: [
|
||||
Kirigami.Action {
|
||||
text: i18n("Open Externally")
|
||||
icon.name: "document-open"
|
||||
onTriggered: downloadAndOpen()
|
||||
},
|
||||
Kirigami.Action {
|
||||
text: i18n("Save As")
|
||||
icon.name: "document-save"
|
||||
onTriggered: saveFileAs()
|
||||
},
|
||||
Kirigami.Action {
|
||||
text: i18n("Reply")
|
||||
icon.name: "mail-replied-symbolic"
|
||||
onTriggered: reply(author, message)
|
||||
},
|
||||
Kirigami.Action {
|
||||
visible: author.id === currentRoom.localUser.id || currentRoom.canSendState("redact")
|
||||
text: i18n("Remove")
|
||||
icon.name: "edit-delete-remove"
|
||||
icon.color: "red"
|
||||
onTriggered: remove()
|
||||
},
|
||||
Kirigami.Action {
|
||||
text: i18n("View Source")
|
||||
icon.name: "code-context"
|
||||
onTriggered: viewSource()
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user