moment/src/qml/Chat/Timeline/EventImage.qml

32 lines
780 B
QML
Raw Normal View History

import QtQuick 2.12
import "../../Base"
HImage {
id: image
x: eventContent.spacing
sourceSize.width: theme.chat.message.thumbnailWidth
sourceSize.height: theme.chat.message.thumbnailWidth
width: Math.min(
mainColumn.width - eventContent.spacing * 2,
implicitWidth,
theme.chat.message.thumbnailWidth,
)
TapHandler {
2019-09-13 06:23:30 +10:00
onTapped: if (! image.animated) Qt.openUrlExternally(image.source)
onDoubleTapped: Qt.openUrlExternally(image.source)
}
HoverHandler {
id: hover
2019-09-07 07:21:41 +10:00
onHoveredChanged:
eventContent.hoveredImage = hovered ? image.source : ""
}
MouseArea {
anchors.fill: image
acceptedButtons: Qt.NoButton
cursorShape: Qt.PointingHandCursor
}
}