mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-01-27 15:57:08 -05:00
Fix Friend Avatar status overlay no depends size scale.
This commit is contained in:
parent
593e57b14c
commit
8b42873968
@ -496,22 +496,21 @@ void FriendList::groupsChanged()
|
|||||||
|
|
||||||
static QIcon createAvatar(const QPixmap &avatar, const QPixmap &overlay)
|
static QIcon createAvatar(const QPixmap &avatar, const QPixmap &overlay)
|
||||||
{
|
{
|
||||||
int avatarWidth = avatar.width();
|
int avatarWidth = avatar.width();
|
||||||
int avatarHeight = avatar.height();
|
int avatarHeight = avatar.height();
|
||||||
|
|
||||||
QPixmap pixmap(avatar);
|
QPixmap pixmap(avatar);
|
||||||
|
|
||||||
int overlayWidth = avatarWidth / 2.5;
|
int overlaySize = (avatarWidth > avatarHeight) ? (avatarWidth/2.5) : (avatarHeight/2.5);
|
||||||
int overlayHeight = avatarHeight / 2.5;
|
int overlayX = avatarWidth - overlaySize;
|
||||||
int overlayX = avatarWidth - overlayWidth;
|
int overlayY = avatarHeight - overlaySize;
|
||||||
int overlayY = avatarHeight - overlayHeight;
|
|
||||||
|
|
||||||
QPainter painter(&pixmap);
|
QPainter painter(&pixmap);
|
||||||
painter.drawPixmap(overlayX, overlayY, overlayWidth, overlayHeight, overlay);
|
painter.drawPixmap(overlayX, overlayY, overlaySize, overlaySize, overlay);
|
||||||
|
|
||||||
QIcon icon;
|
QIcon icon;
|
||||||
icon.addPixmap(pixmap);
|
icon.addPixmap(pixmap);
|
||||||
return icon;
|
return icon;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void getNameWidget(QTreeWidget *treeWidget, QTreeWidgetItem *item, ElidedLabel *&nameLabel, ElidedLabel *&textLabel)
|
static void getNameWidget(QTreeWidget *treeWidget, QTreeWidgetItem *item, ElidedLabel *&nameLabel, ElidedLabel *&textLabel)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user