mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
Merge pull request #1211 from PhenomRetroShare/Fix_AvatarStatusOverlay
Fix Friend Avatar status overlay no depends size scale.
This commit is contained in:
commit
6e8305abda
@ -496,22 +496,21 @@ void FriendList::groupsChanged()
|
||||
|
||||
static QIcon createAvatar(const QPixmap &avatar, const QPixmap &overlay)
|
||||
{
|
||||
int avatarWidth = avatar.width();
|
||||
int avatarHeight = avatar.height();
|
||||
int avatarWidth = avatar.width();
|
||||
int avatarHeight = avatar.height();
|
||||
|
||||
QPixmap pixmap(avatar);
|
||||
QPixmap pixmap(avatar);
|
||||
|
||||
int overlayWidth = avatarWidth / 2.5;
|
||||
int overlayHeight = avatarHeight / 2.5;
|
||||
int overlayX = avatarWidth - overlayWidth;
|
||||
int overlayY = avatarHeight - overlayHeight;
|
||||
int overlaySize = (avatarWidth > avatarHeight) ? (avatarWidth/2.5) : (avatarHeight/2.5);
|
||||
int overlayX = avatarWidth - overlaySize;
|
||||
int overlayY = avatarHeight - overlaySize;
|
||||
|
||||
QPainter painter(&pixmap);
|
||||
painter.drawPixmap(overlayX, overlayY, overlayWidth, overlayHeight, overlay);
|
||||
QPainter painter(&pixmap);
|
||||
painter.drawPixmap(overlayX, overlayY, overlaySize, overlaySize, overlay);
|
||||
|
||||
QIcon icon;
|
||||
icon.addPixmap(pixmap);
|
||||
return icon;
|
||||
QIcon icon;
|
||||
icon.addPixmap(pixmap);
|
||||
return icon;
|
||||
}
|
||||
|
||||
static void getNameWidget(QTreeWidget *treeWidget, QTreeWidgetItem *item, ElidedLabel *&nameLabel, ElidedLabel *&textLabel)
|
||||
|
Loading…
Reference in New Issue
Block a user