From b333a96da2b23b900c46e491afaf9db542557ecc Mon Sep 17 00:00:00 2001 From: defnax Date: Mon, 13 Jan 2020 16:23:54 +0100 Subject: [PATCH] attempt to fix issues with pictures which width are bigger to fit on Label --- retroshare-gui/src/gui/Posted/PostedCardView.cpp | 8 +++++++- retroshare-gui/src/gui/Posted/PostedItem.cpp | 9 ++++++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/retroshare-gui/src/gui/Posted/PostedCardView.cpp b/retroshare-gui/src/gui/Posted/PostedCardView.cpp index e5fd646ce..82bd8b9c3 100644 --- a/retroshare-gui/src/gui/Posted/PostedCardView.cpp +++ b/retroshare-gui/src/gui/Posted/PostedCardView.cpp @@ -309,8 +309,14 @@ void PostedCardView::fill() // Wiping data - as its been passed to thumbnail. 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) { diff --git a/retroshare-gui/src/gui/Posted/PostedItem.cpp b/retroshare-gui/src/gui/Posted/PostedItem.cpp index b797a1dbe..b165f2f00 100644 --- a/retroshare-gui/src/gui/Posted/PostedItem.cpp +++ b/retroshare-gui/src/gui/Posted/PostedItem.cpp @@ -319,8 +319,15 @@ void PostedItem::fill() QPixmap sqpixmap = pixmap.scaled(desired_width,desired_height, Qt::KeepAspectRatioByExpanding, Qt::SmoothTransformation); ui->thumbnailLabel->setPixmap(sqpixmap); - ui->pictureLabel->setPixmap(pixmap); 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)) {