2018-07-12 01:44:41 +00:00
|
|
|
import QtQuick 2.9
|
|
|
|
import QtQuick.Controls 2.2
|
|
|
|
import QtQuick.Controls.Material 2.2
|
2018-07-10 04:18:21 +00:00
|
|
|
|
2018-07-10 06:34:17 +00:00
|
|
|
AvatarContainer {
|
2018-07-10 04:18:21 +00:00
|
|
|
Rectangle {
|
|
|
|
id: messageRect
|
|
|
|
|
|
|
|
width: messageImage.implicitWidth + 24
|
|
|
|
height: messageImage.implicitHeight + 24
|
|
|
|
|
2018-07-20 04:14:02 +00:00
|
|
|
color: sentByMe ? background : Material.accent
|
2018-07-10 04:18:21 +00:00
|
|
|
|
2018-07-10 06:34:17 +00:00
|
|
|
DownloadableContent {
|
|
|
|
id: downloadable
|
|
|
|
|
|
|
|
width: messageImage.width
|
|
|
|
height: messageImage.height
|
2018-07-10 04:18:21 +00:00
|
|
|
anchors.centerIn: parent
|
|
|
|
|
2018-07-10 06:34:17 +00:00
|
|
|
Image {
|
|
|
|
id: messageImage
|
2018-07-20 04:14:02 +00:00
|
|
|
z: -4
|
2018-08-01 12:26:29 +00:00
|
|
|
sourceSize.width: 128
|
2018-07-17 08:18:50 +00:00
|
|
|
source: "image://mxc/" + (content.thumbnail_url ? content.thumbnail_url : content.url)
|
2018-07-10 06:34:17 +00:00
|
|
|
|
|
|
|
MouseArea {
|
|
|
|
anchors.fill: parent
|
|
|
|
|
|
|
|
hoverEnabled: true
|
2018-07-19 13:02:06 +00:00
|
|
|
acceptedButtons: Qt.LeftButton | Qt.RightButton
|
2018-07-10 06:34:17 +00:00
|
|
|
propagateComposedEvents: true
|
|
|
|
ToolTip.visible: containsMouse
|
|
|
|
ToolTip.text: content.body
|
2018-07-10 04:18:21 +00:00
|
|
|
|
2018-07-19 13:02:06 +00:00
|
|
|
onClicked: mouse.button & Qt.LeftButton ? downloadable.downloadAndOpen() : downloadable.saveFileAs()
|
2018-07-10 06:34:17 +00:00
|
|
|
}
|
2018-07-10 04:18:21 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|