summary refs log tree commit diff
diff options
context:
space:
mode:
authorNicolas Werner <nicolas.werner@hotmail.de>2021-08-16 12:47:44 +0200
committerNicolas Werner <nicolas.werner@hotmail.de>2021-08-16 12:48:45 +0200
commit1e7756c508401cea6f840e46b799f80baf949a7b (patch)
tree9936748840597818c01573cdca7b8718ff16c459
parentMerge pull request #680 from govynnus/token-registration (diff)
downloadnheko-1e7756c508401cea6f840e46b799f80baf949a7b.tar.xz
Fix dpi scaling of avatars
-rw-r--r--resources/qml/Avatar.qml6
-rw-r--r--src/MxcImageProvider.cpp2
2 files changed, 4 insertions, 4 deletions
diff --git a/resources/qml/Avatar.qml b/resources/qml/Avatar.qml

index c3e8acdb..4a9a565c 100644 --- a/resources/qml/Avatar.qml +++ b/resources/qml/Avatar.qml
@@ -20,7 +20,7 @@ Rectangle { width: 48 height: 48 - radius: Settings.avatarCircles ? height / 2 : 3 + radius: Settings.avatarCircles ? height / 2 : height / 8 color: Nheko.colors.alternateBase Component.onCompleted: { mouseArea.clicked.connect(clicked); @@ -49,7 +49,7 @@ Rectangle { smooth: true sourceSize.width: avatar.width sourceSize.height: avatar.height - source: avatar.url ? (avatar.url + "?radius=" + radius + ((avatar.crop) ? "" : "&scale")) : "" + source: avatar.url ? (avatar.url + "?radius=" + (Settings.avatarCircles ? 100.0 : 25.0) + ((avatar.crop) ? "" : "&scale")) : "" MouseArea { id: mouseArea @@ -71,7 +71,7 @@ Rectangle { visible: !!userid height: avatar.height / 6 width: height - radius: Settings.avatarCircles ? height / 2 : height / 4 + radius: Settings.avatarCircles ? height / 2 : height / 8 color: { switch (TimelineManager.userPresence(userid)) { case "online": diff --git a/src/MxcImageProvider.cpp b/src/MxcImageProvider.cpp
index 58078a3b..056374a9 100644 --- a/src/MxcImageProvider.cpp +++ b/src/MxcImageProvider.cpp
@@ -82,7 +82,7 @@ clipRadius(QImage img, double radius) painter.setRenderHint(QPainter::SmoothPixmapTransform, true); QPainterPath ppath; - ppath.addRoundedRect(img.rect(), radius, radius); + ppath.addRoundedRect(img.rect(), radius, radius, Qt::SizeMode::RelativeSize); painter.setClipPath(ppath); painter.drawImage(img.rect(), img);