Add externally open image support & file download support && more code
cleanup.
This commit is contained in:
@@ -2,30 +2,7 @@ import QtQuick 2.11
|
||||
import QtQuick.Controls 2.4
|
||||
import QtQuick.Controls.Material 2.4
|
||||
|
||||
Row {
|
||||
id: messageRow
|
||||
|
||||
spacing: 6
|
||||
|
||||
ImageStatus {
|
||||
id: avatar
|
||||
|
||||
width: height
|
||||
height: 40
|
||||
round: false
|
||||
visible: !sentByMe
|
||||
source: author.avatarUrl != "" ? "image://mxc/" + author.avatarUrl : null
|
||||
displayText: author.displayName
|
||||
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
|
||||
hoverEnabled: true
|
||||
ToolTip.visible: containsMouse
|
||||
ToolTip.text: author.displayName
|
||||
}
|
||||
}
|
||||
|
||||
AvatarContainer {
|
||||
Rectangle {
|
||||
id: messageRect
|
||||
|
||||
@@ -34,18 +11,27 @@ Row {
|
||||
|
||||
color: sentByMe ? "lightgrey" : Material.accent
|
||||
|
||||
Image {
|
||||
id: messageImage
|
||||
DownloadableContent {
|
||||
id: downloadable
|
||||
|
||||
width: messageImage.width
|
||||
height: messageImage.height
|
||||
anchors.centerIn: parent
|
||||
source: "image://mxc/" + content.url
|
||||
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
Image {
|
||||
id: messageImage
|
||||
source: "image://mxc/" + content.url
|
||||
|
||||
hoverEnabled: true
|
||||
propagateComposedEvents: true
|
||||
ToolTip.visible: containsMouse
|
||||
ToolTip.text: content.body
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
|
||||
hoverEnabled: true
|
||||
propagateComposedEvents: true
|
||||
ToolTip.visible: containsMouse
|
||||
ToolTip.text: content.body
|
||||
|
||||
onClicked: downloadable.downloadAndOpen()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user