2019-09-03 17:04:57 +10:00
|
|
|
import QtQuick 2.12
|
|
|
|
import "../../Base"
|
2019-09-20 05:49:29 +10:00
|
|
|
import "../../utils.js" as Utils
|
2019-09-03 17:04:57 +10:00
|
|
|
|
|
|
|
HImage {
|
|
|
|
id: image
|
2019-10-28 04:26:00 +11:00
|
|
|
horizontalAlignment: Image.AlignLeft
|
|
|
|
sourceSize.width: theme.chat.message.thumbnailWidth // FIXME
|
2019-10-30 21:47:59 +11:00
|
|
|
source: animated ? openUrl : thumbnailUrl
|
2019-09-03 17:04:57 +10:00
|
|
|
|
2019-09-14 15:03:56 +10:00
|
|
|
|
2019-10-30 21:47:59 +11:00
|
|
|
property url thumbnailUrl
|
|
|
|
property url fullImageUrl
|
|
|
|
|
|
|
|
readonly property url openUrl: fullImageUrl || thumbnailUrl
|
2019-09-14 15:03:56 +10:00
|
|
|
|
|
|
|
|
2019-09-03 17:04:57 +10:00
|
|
|
TapHandler {
|
2019-10-30 21:47:59 +11:00
|
|
|
onTapped: if (! image.animated) Qt.openUrlExternally(openUrl)
|
|
|
|
onDoubleTapped: Qt.openUrlExternally(openUrl)
|
2019-09-03 17:04:57 +10:00
|
|
|
}
|
|
|
|
|
|
|
|
HoverHandler {
|
|
|
|
id: hover
|
2019-09-07 07:21:41 +10:00
|
|
|
onHoveredChanged:
|
2019-09-15 08:33:32 +10:00
|
|
|
eventDelegate.hoveredMediaTypeUrl =
|
2019-10-30 21:47:59 +11:00
|
|
|
hovered ? [EventDelegate.Media.Image, openUrl] : []
|
2019-09-03 17:04:57 +10:00
|
|
|
}
|
|
|
|
}
|