EventImage: open/copy original image on clicks

This commit is contained in:
miruka 2019-09-14 01:03:56 -04:00
parent 45b6714bcb
commit 69aea0e37f
3 changed files with 11 additions and 4 deletions

View File

@ -1,10 +1,12 @@
- Media
- Caching
- Downloading
- Uploading (+local echo)
- GIF thumbnails: load the real animated image
- Files, links, video, audio
- Encrypted media
- Loading animation
- Copy thumbnail URL in context menu?
- RoomMessageNotice

View File

@ -12,15 +12,20 @@ HImage {
theme.chat.message.thumbnailWidth,
)
// source = thumbnail, fullSource = full original image
property url fullSource: source
TapHandler {
onTapped: if (! image.animated) Qt.openUrlExternally(image.source)
onDoubleTapped: Qt.openUrlExternally(image.source)
onTapped: if (! image.animated) Qt.openUrlExternally(image.fullSource)
onDoubleTapped: Qt.openUrlExternally(image.fullSource)
}
HoverHandler {
id: hover
onHoveredChanged:
eventContent.hoveredImage = hovered ? image.source : ""
eventContent.hoveredImage = hovered ? image.fullSource : ""
}
MouseArea {

View File

@ -55,7 +55,7 @@ HLoader {
onPreviewUrlChanged: {
if (type === EventMediaLoader.Type.Image) {
var file = "EventImage.qml"
var props = { source: previewUrl }
var props = { source: previewUrl, fullSource: mediaUrl }
} else {
return
}