mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-22 11:00:48 +03:00
Add support for viewing avatar images in full size
This commit is contained in:
parent
b9dcdbcb81
commit
e36b090c5b
2 changed files with 11 additions and 0 deletions
|
@ -9,6 +9,8 @@ Rectangle {
|
||||||
property alias url: img.source
|
property alias url: img.source
|
||||||
property string userid
|
property string userid
|
||||||
property string displayName
|
property string displayName
|
||||||
|
|
||||||
|
property string usrUrl: TimelineManager.timeline.avatarUrl(userid)
|
||||||
|
|
||||||
width: 48
|
width: 48
|
||||||
height: 48
|
height: 48
|
||||||
|
@ -49,6 +51,14 @@ Rectangle {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
MouseArea {
|
||||||
|
id: mouseArea
|
||||||
|
|
||||||
|
anchors.fill: parent
|
||||||
|
onClicked: {
|
||||||
|
TimelineManager.openImageOverlay(usrUrl, TimelineManager.timeline.data.id)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
|
|
|
@ -339,6 +339,7 @@ TimelineViewManager::toggleCameraView()
|
||||||
void
|
void
|
||||||
TimelineViewManager::openImageOverlay(QString mxcUrl, QString eventId) const
|
TimelineViewManager::openImageOverlay(QString mxcUrl, QString eventId) const
|
||||||
{
|
{
|
||||||
|
if (mxcUrl.isEmpty() || mxcUrl.isNull()) { 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]() {
|
||||||
|
|
Loading…
Reference in a new issue