smooth scaled small avatars in lobby dialog
This commit is contained in:
@@ -1034,11 +1034,12 @@ void gameLobbyDialogImpl::refreshConnectedPlayerAvatars() {
|
|||||||
QFile myAvatarFile(myAvatarString);
|
QFile myAvatarFile(myAvatarString);
|
||||||
if(myAvatarFile.exists()) {
|
if(myAvatarFile.exists()) {
|
||||||
|
|
||||||
|
QPixmap tempAvatar(myAvatarString);
|
||||||
QPixmap myAvatarPixmap(25,26);
|
QPixmap myAvatarPixmap(25,26);
|
||||||
myAvatarPixmap.fill(Qt::transparent);
|
myAvatarPixmap.fill(Qt::transparent);
|
||||||
QPixmap tempPixmap(myAvatarString);
|
|
||||||
QPainter p(&myAvatarPixmap);
|
QPainter p(&myAvatarPixmap);
|
||||||
p.drawPixmap (0,0,25,25,tempPixmap);
|
p.drawPixmap (0,0,25,25, tempAvatar.scaled(25,25,Qt::KeepAspectRatio,Qt::SmoothTransformation));
|
||||||
|
|
||||||
(*it)->setIcon(0, QIcon(myAvatarPixmap));
|
(*it)->setIcon(0, QIcon(myAvatarPixmap));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user