matrixion/resources/qml/delegates/ImageMessage.qml

24 lines
479 B
QML
Raw Normal View History

import QtQuick 2.6
import im.nheko 1.0
2019-10-06 02:44:02 +03:00
Item {
2019-10-28 00:01:40 +03:00
width: Math.min(parent ? parent.width : undefined, model.width)
2019-10-09 01:36:03 +03:00
height: width * model.proportionalHeight
Image {
2019-09-28 12:07:58 +03:00
id: img
anchors.fill: parent
source: model.url.replace("mxc://", "image://MxcImage/")
asynchronous: true
fillMode: Image.PreserveAspectFit
2019-09-28 12:07:58 +03:00
MouseArea {
enabled: model.type == MtxEvent.ImageMessage
2019-09-28 12:07:58 +03:00
anchors.fill: parent
2019-12-03 04:26:41 +03:00
onClicked: timelineManager.openImageOverlay(model.url, model.id)
2019-09-28 12:07:58 +03:00
}
}
}