2019-09-15 07:48:53 +10:00
|
|
|
import QtQuick 2.12
|
|
|
|
import QtQuick.Layouts 1.12
|
|
|
|
import "../../Base"
|
|
|
|
|
|
|
|
HTile {
|
|
|
|
width: Math.min(
|
|
|
|
mainColumn.width - eventContent.spacing * 2,
|
|
|
|
theme.chat.message.thumbnailWidth,
|
|
|
|
)
|
|
|
|
|
2019-09-15 08:33:32 +10:00
|
|
|
onClicked: Qt.openUrlExternally(fileUrl)
|
|
|
|
|
|
|
|
onHoveredChanged:
|
|
|
|
eventDelegate.hoveredMediaTypeUrl =
|
|
|
|
hovered ? [EventDelegate.Media.File, fileUrl] : []
|
|
|
|
|
2019-09-15 07:48:53 +10:00
|
|
|
|
|
|
|
property url thumbnailUrl
|
|
|
|
property url fileUrl
|
|
|
|
property string fileTitle: ""
|
|
|
|
property int fileSize: 0
|
|
|
|
|
|
|
|
|
|
|
|
title.text: fileTitle || qsTr("Untitled file")
|
|
|
|
title.elide: Text.ElideMiddle
|
|
|
|
|
|
|
|
subtitle.text: CppUtils.formattedBytes(fileSize)
|
|
|
|
|
|
|
|
image: HIcon {
|
|
|
|
svgName: "download"
|
|
|
|
}
|
|
|
|
}
|