mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-29 14:18:49 +03:00
Fix dpi scaling of avatars
This commit is contained in:
parent
b1634d60a0
commit
1e7756c508
2 changed files with 4 additions and 4 deletions
|
@ -20,7 +20,7 @@ Rectangle {
|
||||||
|
|
||||||
width: 48
|
width: 48
|
||||||
height: 48
|
height: 48
|
||||||
radius: Settings.avatarCircles ? height / 2 : 3
|
radius: Settings.avatarCircles ? height / 2 : height / 8
|
||||||
color: Nheko.colors.alternateBase
|
color: Nheko.colors.alternateBase
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
mouseArea.clicked.connect(clicked);
|
mouseArea.clicked.connect(clicked);
|
||||||
|
@ -49,7 +49,7 @@ Rectangle {
|
||||||
smooth: true
|
smooth: true
|
||||||
sourceSize.width: avatar.width
|
sourceSize.width: avatar.width
|
||||||
sourceSize.height: avatar.height
|
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 {
|
MouseArea {
|
||||||
id: mouseArea
|
id: mouseArea
|
||||||
|
@ -71,7 +71,7 @@ Rectangle {
|
||||||
visible: !!userid
|
visible: !!userid
|
||||||
height: avatar.height / 6
|
height: avatar.height / 6
|
||||||
width: height
|
width: height
|
||||||
radius: Settings.avatarCircles ? height / 2 : height / 4
|
radius: Settings.avatarCircles ? height / 2 : height / 8
|
||||||
color: {
|
color: {
|
||||||
switch (TimelineManager.userPresence(userid)) {
|
switch (TimelineManager.userPresence(userid)) {
|
||||||
case "online":
|
case "online":
|
||||||
|
|
|
@ -82,7 +82,7 @@ clipRadius(QImage img, double radius)
|
||||||
painter.setRenderHint(QPainter::SmoothPixmapTransform, true);
|
painter.setRenderHint(QPainter::SmoothPixmapTransform, true);
|
||||||
|
|
||||||
QPainterPath ppath;
|
QPainterPath ppath;
|
||||||
ppath.addRoundedRect(img.rect(), radius, radius);
|
ppath.addRoundedRect(img.rect(), radius, radius, Qt::SizeMode::RelativeSize);
|
||||||
|
|
||||||
painter.setClipPath(ppath);
|
painter.setClipPath(ppath);
|
||||||
painter.drawImage(img.rect(), img);
|
painter.drawImage(img.rect(), img);
|
||||||
|
|
Loading…
Reference in a new issue