Spectral/qml/component/ImageBubble.qml

39 lines
952 B
QML
Raw Normal View History

2018-07-10 04:18:21 +00:00
import QtQuick 2.11
import QtQuick.Controls 2.4
import QtQuick.Controls.Material 2.4
AvatarContainer {
2018-07-10 04:18:21 +00:00
Rectangle {
id: messageRect
width: messageImage.implicitWidth + 24
height: messageImage.implicitHeight + 24
color: sentByMe ? "lightgrey" : Material.accent
DownloadableContent {
id: downloadable
width: messageImage.width
height: messageImage.height
2018-07-10 04:18:21 +00:00
anchors.centerIn: parent
Image {
id: messageImage
source: "image://mxc/" + content.url
MouseArea {
anchors.fill: parent
hoverEnabled: true
propagateComposedEvents: true
ToolTip.visible: containsMouse
ToolTip.text: content.body
2018-07-10 04:18:21 +00:00
onClicked: downloadable.downloadAndOpen()
}
2018-07-10 04:18:21 +00:00
}
}
}
}