mirror of
https://gitlab.com/comunic/comunicmessages
synced 2025-06-20 08:55:17 +00:00
Display conversation images
This commit is contained in:
@ -135,7 +135,17 @@ void ImageLoadHelper::ApplyImage(QLabel *label, const QString &url)
|
||||
|
||||
void ImageLoadHelper::ApplyImage(QLabel *label, const QPixmap &pixmap)
|
||||
{
|
||||
label->setPixmap(pixmap);
|
||||
//Check if we need to scale image
|
||||
if(
|
||||
(label->maximumWidth() > 100000 || label->maximumHeight() > 100000) || //No maximum size
|
||||
(label->maximumWidth() > pixmap.width() && label->maximumHeight() > pixmap.height()) //Image smaller than maximum size
|
||||
){
|
||||
label->setPixmap(pixmap);
|
||||
return;
|
||||
}
|
||||
|
||||
//Else we scale image
|
||||
label->setPixmap(pixmap.scaled(label->maximumSize(), Qt::KeepAspectRatio));
|
||||
}
|
||||
|
||||
bool ImageLoadHelper::IsDownloaded(const QString &url)
|
||||
|
Reference in New Issue
Block a user