mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-02-17 21:34:10 -05:00
added to check pixmap width & height before scale, only scale when needed
This commit is contained in:
parent
dcddda81f3
commit
21cf49a009
@ -53,7 +53,10 @@ void PhotoView::setPixmap(const QPixmap& pixmap)
|
|||||||
{
|
{
|
||||||
QPixmap sqpixmap = pixmap.scaled(640,480, Qt::KeepAspectRatio, Qt::SmoothTransformation);
|
QPixmap sqpixmap = pixmap.scaled(640,480, Qt::KeepAspectRatio, Qt::SmoothTransformation);
|
||||||
|
|
||||||
ui->photoLabel->setPixmap(sqpixmap);
|
if(pixmap.width() > 800 || pixmap.height() > 700)
|
||||||
|
ui->photoLabel->setPixmap(sqpixmap);
|
||||||
|
else
|
||||||
|
ui->photoLabel->setPixmap(pixmap);
|
||||||
}
|
}
|
||||||
|
|
||||||
void PhotoView::setTitle(const QString& text)
|
void PhotoView::setTitle(const QString& text)
|
||||||
@ -67,7 +70,7 @@ void PhotoView::setName(const RsGxsId& authorID)
|
|||||||
|
|
||||||
RsIdentityDetails idDetails ;
|
RsIdentityDetails idDetails ;
|
||||||
rsIdentity->getIdDetails(authorID,idDetails);
|
rsIdentity->getIdDetails(authorID,idDetails);
|
||||||
|
|
||||||
QPixmap pixmap ;
|
QPixmap pixmap ;
|
||||||
|
|
||||||
if(idDetails.mAvatar.mSize == 0 || !GxsIdDetails::loadPixmapFromData(idDetails.mAvatar.mData, idDetails.mAvatar.mSize, pixmap,GxsIdDetails::SMALL))
|
if(idDetails.mAvatar.mSize == 0 || !GxsIdDetails::loadPixmapFromData(idDetails.mAvatar.mData, idDetails.mAvatar.mSize, pixmap,GxsIdDetails::SMALL))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user