attempt to fix issues with pictures which width are bigger to fit on Label

This commit is contained in:
defnax 2020-01-13 16:23:54 +01:00
parent b1f45536a2
commit b333a96da2
2 changed files with 15 additions and 2 deletions

View File

@ -309,8 +309,14 @@ void PostedCardView::fill()
// Wiping data - as its been passed to thumbnail. // Wiping data - as its been passed to thumbnail.
QPixmap sqpixmap = pixmap.scaled(desired_width,desired_height, Qt::KeepAspectRatioByExpanding, Qt::SmoothTransformation); QPixmap sqpixmap = pixmap.scaled(desired_width,desired_height, Qt::KeepAspectRatioByExpanding, Qt::SmoothTransformation);
QPixmap squaledpixmap = pixmap.scaled(640,480, Qt::KeepAspectRatio, Qt::SmoothTransformation);
if(pixmap.width() > 800)
ui->pictureLabel->setPixmap(squaledpixmap);
else
ui->pictureLabel->setPixmap(pixmap);
ui->pictureLabel->setPixmap(pixmap);
} }
else if (mPost.mImage.mData == NULL) else if (mPost.mImage.mData == NULL)
{ {

View File

@ -319,8 +319,15 @@ void PostedItem::fill()
QPixmap sqpixmap = pixmap.scaled(desired_width,desired_height, Qt::KeepAspectRatioByExpanding, Qt::SmoothTransformation); QPixmap sqpixmap = pixmap.scaled(desired_width,desired_height, Qt::KeepAspectRatioByExpanding, Qt::SmoothTransformation);
ui->thumbnailLabel->setPixmap(sqpixmap); ui->thumbnailLabel->setPixmap(sqpixmap);
ui->pictureLabel->setPixmap(pixmap);
ui->thumbnailLabel->setToolTip(tr("Click to view Picture")); ui->thumbnailLabel->setToolTip(tr("Click to view Picture"));
QPixmap squaledpixmap = pixmap.scaled(640,480, Qt::KeepAspectRatio, Qt::SmoothTransformation);
if(pixmap.width() > 800)
ui->pictureLabel->setPixmap(squaledpixmap);
else
ui->pictureLabel->setPixmap(pixmap);
} }
else if (urlOkay && (mPost.mImage.mData == NULL)) else if (urlOkay && (mPost.mImage.mData == NULL))
{ {