nheko/resources/qml/delegates/ImageMessage.qml

24 lines
521 B
QML
Raw Normal View History

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