mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-01-26 23:36:59 -05:00
attempt to improve
This commit is contained in:
parent
21cf49a009
commit
f8f77f122e
@ -51,12 +51,17 @@ PhotoView::~PhotoView()
|
|||||||
|
|
||||||
void PhotoView::setPixmap(const QPixmap& pixmap)
|
void PhotoView::setPixmap(const QPixmap& pixmap)
|
||||||
{
|
{
|
||||||
QPixmap sqpixmap = pixmap.scaled(640,480, Qt::KeepAspectRatio, Qt::SmoothTransformation);
|
QPixmap sqpixmap;
|
||||||
|
if(pixmap.width() > 800 ){
|
||||||
if(pixmap.width() > 800 || pixmap.height() > 700)
|
QPixmap sqpixmap = pixmap.scaled(640,480, Qt::KeepAspectRatio, Qt::SmoothTransformation);
|
||||||
ui->photoLabel->setPixmap(sqpixmap);
|
ui->photoLabel->setPixmap(sqpixmap);
|
||||||
else
|
}else if (pixmap.height() > 600){
|
||||||
|
QPixmap sqpixmap = pixmap.scaled(480,640, Qt::KeepAspectRatio, Qt::SmoothTransformation);
|
||||||
|
ui->photoLabel->setPixmap(sqpixmap);
|
||||||
|
}
|
||||||
|
else{
|
||||||
ui->photoLabel->setPixmap(pixmap);
|
ui->photoLabel->setPixmap(pixmap);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void PhotoView::setTitle(const QString& text)
|
void PhotoView::setTitle(const QString& text)
|
||||||
@ -102,5 +107,6 @@ void PhotoView::copyMessageLink()
|
|||||||
QList<RetroShareLink> urls;
|
QList<RetroShareLink> urls;
|
||||||
urls.push_back(link);
|
urls.push_back(link);
|
||||||
RSLinkClipboard::copyLinks(urls);
|
RSLinkClipboard::copyLinks(urls);
|
||||||
|
QMessageBox::information(NULL,tr("information"),tr("The Retrohare link was copied to your clipboard.")) ;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -308,15 +308,13 @@ void PostedCardView::fill()
|
|||||||
GxsIdDetails::loadPixmapFromData(mPost.mImage.mData, mPost.mImage.mSize, pixmap,GxsIdDetails::ORIGINAL);
|
GxsIdDetails::loadPixmapFromData(mPost.mImage.mData, mPost.mImage.mSize, pixmap,GxsIdDetails::ORIGINAL);
|
||||||
// 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 scaledpixmap;
|
||||||
|
if(pixmap.width() > 800){
|
||||||
QPixmap squaledpixmap = pixmap.scaled(640,480, Qt::KeepAspectRatio, Qt::SmoothTransformation);
|
QPixmap scaledpixmap = pixmap.scaledToWidth(800, Qt::SmoothTransformation);
|
||||||
|
ui->pictureLabel->setPixmap(scaledpixmap);
|
||||||
if(pixmap.width() > 800)
|
}else{
|
||||||
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)
|
||||||
{
|
{
|
||||||
|
@ -321,13 +321,13 @@ void PostedItem::fill()
|
|||||||
ui->thumbnailLabel->setPixmap(sqpixmap);
|
ui->thumbnailLabel->setPixmap(sqpixmap);
|
||||||
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);
|
QPixmap scaledpixmap;
|
||||||
|
if(pixmap.width() > 800){
|
||||||
if(pixmap.width() > 800)
|
QPixmap scaledpixmap = pixmap.scaledToWidth(800, Qt::SmoothTransformation);
|
||||||
ui->pictureLabel->setPixmap(squaledpixmap);
|
ui->pictureLabel->setPixmap(scaledpixmap);
|
||||||
else
|
}else{
|
||||||
ui->pictureLabel->setPixmap(pixmap);
|
ui->pictureLabel->setPixmap(pixmap);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (urlOkay && (mPost.mImage.mData == NULL))
|
else if (urlOkay && (mPost.mImage.mData == NULL))
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user