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 - Media
- Caching - Caching
- Downloading - Downloading
- Uploading (+local echo)
- GIF thumbnails: load the real animated image - GIF thumbnails: load the real animated image
- Files, links, video, audio - Files, links, video, audio
- Encrypted media - Encrypted media
- Loading animation - Loading animation
- Copy thumbnail URL in context menu?
- RoomMessageNotice - RoomMessageNotice

View File

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

View File

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