Newer
Older
import QtQuick.Layouts 1.2
import QtQuick.Window 2.2
import com.github.nheko 1.0
anchors.leftMargin: avatarSize + 4
anchors.left: parent.left
anchors.right: parent.right
Nicolas Werner
committed
height: Math.max(contentItem.height, 16)
Layout.fillWidth: true
Layout.alignment: Qt.AlignTop
//property var replyTo: model.replyTo
//Text {
// property int idx: timelineManager.timeline.idToIndex(replyTo)
// text: "" + (idx != -1 ? timelineManager.timeline.data(timelineManager.timeline.index(idx, 0), 2) : "nothing")
//}
MessageDelegate {
Nicolas Werner
committed
id: contentItem
width: parent.width
height: childrenRect.height
}
}
StatusIndicator {
state: model.state
Layout.alignment: Qt.AlignRight | Qt.AlignTop
Layout.preferredHeight: 16
}
EncryptionIndicator {
visible: model.isEncrypted
Layout.alignment: Qt.AlignRight | Qt.AlignTop
Layout.preferredHeight: 16
}
Layout.alignment: Qt.AlignRight | Qt.AlignTop
Layout.preferredHeight: 16
image: ":/icons/icons/ui/mail-reply.png"
ToolTip {
visible: replyButton.hovered
text: qsTr("Reply")
palette: colors
}
onClicked: view.model.replyAction(model.id)
}
Layout.alignment: Qt.AlignRight | Qt.AlignTop
Layout.preferredHeight: 16
image: ":/icons/icons/ui/vertical-ellipsis.png"
ToolTip {
visible: optionsButton.hovered
text: qsTr("Options")
palette: colors
}
onClicked: contextMenu.open()
Menu {
y: optionsButton.height
id: contextMenu
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
MenuItem {
text: qsTr("Read receipts")
onTriggered: view.model.readReceiptsAction(model.id)
}
MenuItem {
text: qsTr("Mark as read")
}
MenuItem {
text: qsTr("View raw message")
onTriggered: view.model.viewRawMessage(model.id)
}
MenuItem {
text: qsTr("Redact message")
onTriggered: view.model.redactEvent(model.id)
}
MenuItem {
visible: model.type == MtxEvent.ImageMessage || model.type == MtxEvent.VideoMessage || model.type == MtxEvent.AudioMessage || model.type == MtxEvent.FileMessage || model.type == MtxEvent.Sticker
text: qsTr("Save as")
onTriggered: timelineManager.saveMedia(model.url, model.filename, model.mimetype, model.type)
}
}
}
Text {
Layout.alignment: Qt.AlignRight | Qt.AlignTop
text: model.timestamp.toLocaleTimeString("HH:mm")
color: inactiveColors.text
MouseArea{
id: ma
anchors.fill: parent
hoverEnabled: true
}
ToolTip {
visible: ma.containsMouse
text: Qt.formatDateTime(model.timestamp, Qt.DefaultLocaleLongDate)
palette: colors
}