Add support for viewing avatar images in full size

This commit is contained in:
kamathmanu 2020-11-30 10:05:24 -05:00
parent b9dcdbcb81
commit e36b090c5b
2 changed files with 11 additions and 0 deletions

View File

@ -10,6 +10,8 @@ Rectangle {
property string userid
property string displayName
property string usrUrl: TimelineManager.timeline.avatarUrl(userid)
width: 48
height: 48
radius: Settings.avatarCircles ? height / 2 : 3
@ -49,6 +51,14 @@ Rectangle {
}
MouseArea {
id: mouseArea
anchors.fill: parent
onClicked: {
TimelineManager.openImageOverlay(usrUrl, TimelineManager.timeline.data.id)
}
}
}
Rectangle {

View File

@ -339,6 +339,7 @@ TimelineViewManager::toggleCameraView()
void
TimelineViewManager::openImageOverlay(QString mxcUrl, QString eventId) const
{
if (mxcUrl.isEmpty() || mxcUrl.isNull()) { return; }
QQuickImageResponse *imgResponse =
imgProvider->requestImageResponse(mxcUrl.remove("mxc://"), QSize());
connect(imgResponse, &QQuickImageResponse::finished, this, [this, eventId, imgResponse]() {