Play m.image events GIFs, rename some properties

This commit is contained in:
miruka
2019-10-30 06:47:59 -04:00
parent b11c9d5675
commit 2e4a7904d5
4 changed files with 23 additions and 15 deletions

View File

@@ -6,21 +6,24 @@ HImage {
id: image
horizontalAlignment: Image.AlignLeft
sourceSize.width: theme.chat.message.thumbnailWidth // FIXME
source: animated ? openUrl : thumbnailUrl
// source = thumbnail, fullSource = full original image
property url fullSource: source
property url thumbnailUrl
property url fullImageUrl
readonly property url openUrl: fullImageUrl || thumbnailUrl
TapHandler {
onTapped: if (! image.animated) Qt.openUrlExternally(fullSource)
onDoubleTapped: Qt.openUrlExternally(fullSource)
onTapped: if (! image.animated) Qt.openUrlExternally(openUrl)
onDoubleTapped: Qt.openUrlExternally(openUrl)
}
HoverHandler {
id: hover
onHoveredChanged:
eventDelegate.hoveredMediaTypeUrl =
hovered ? [EventDelegate.Media.Image, fullSource] : []
hovered ? [EventDelegate.Media.Image, openUrl] : []
}
}