Merge pull request #347 from kamathmanu/avatarFullViewSupport

Add support for viewing avatar images in full size
This commit is contained in:
DeepBlueV7.X 2020-11-30 21:25:42 +01:00 committed by GitHub
commit 95667edb14
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 0 deletions

View file

@ -49,6 +49,12 @@ Rectangle {
} }
MouseArea {
id: mouseArea
anchors.fill: parent
onClicked: TimelineManager.openImageOverlay(TimelineManager.timeline.avatarUrl(userid), TimelineManager.timeline.data.id)
}
} }
Rectangle { Rectangle {

View file

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