2019-09-03 17:04:57 +10:00
|
|
|
import QtQuick 2.12
|
|
|
|
import "../../Base"
|
|
|
|
|
|
|
|
HImage {
|
|
|
|
id: image
|
|
|
|
x: eventContent.spacing
|
|
|
|
sourceSize.width: maxDimension
|
|
|
|
sourceSize.height: maxDimension
|
|
|
|
width: Math.min(
|
|
|
|
mainColumn.width - eventContent.spacing * 2,
|
|
|
|
implicitWidth,
|
|
|
|
maxDimension,
|
|
|
|
)
|
|
|
|
|
|
|
|
property int maxDimension: window.settings.messageImageMaxThumbnailSize
|
|
|
|
|
|
|
|
TapHandler {
|
|
|
|
onTapped: Qt.openUrlExternally(image.source)
|
|
|
|
}
|
|
|
|
|
|
|
|
HoverHandler {
|
|
|
|
id: hover
|
2019-09-07 07:21:41 +10:00
|
|
|
onHoveredChanged:
|
|
|
|
eventContent.hoveredImage = hovered ? image.source : ""
|
2019-09-03 17:04:57 +10:00
|
|
|
}
|
|
|
|
|
|
|
|
MouseArea {
|
|
|
|
anchors.fill: image
|
|
|
|
acceptedButtons: Qt.NoButton
|
|
|
|
cursorShape: Qt.PointingHandCursor
|
|
|
|
}
|
|
|
|
}
|