fixed default size of default icon in boards

This commit is contained in:
csoler 2020-10-03 18:59:44 +02:00
parent 5e3dab62fd
commit f064325592

View File

@ -353,6 +353,9 @@ void BoardPostDisplayWidget_compact::setup()
} }
else else
{ {
int desired_height = QFontMetricsF(font()).height() * 5;
ui->pictureLabel->setFixedSize(16/9.0*desired_height,desired_height);
if(mPost.mImage.mData != NULL) if(mPost.mImage.mData != NULL)
{ {
QPixmap pixmap; QPixmap pixmap;
@ -365,13 +368,10 @@ void BoardPostDisplayWidget_compact::setup()
pixmap.save("pix.png","PNG"); pixmap.save("pix.png","PNG");
#endif #endif
int desired_height = QFontMetricsF(font()).height() * 5;
ui->pictureLabel->setFixedSize(16/9.0*desired_height,desired_height);
ui->pictureLabel->setPicture(pixmap); ui->pictureLabel->setPicture(pixmap);
} }
else else
ui->pictureLabel->setPicture( FilesDefs::getPixmapFromQtResourcePath(":/images/thumb-default.png") ); ui->pictureLabel->setPicture( FilesDefs::getPixmapFromQtResourcePath(":/images/thumb-default.png") );
} }
ui->notes->setText(RsHtml().formatText(NULL, QString::fromUtf8(mPost.mNotes.c_str()), RSHTML_FORMATTEXT_EMBED_SMILEYS | RSHTML_FORMATTEXT_EMBED_LINKS)); ui->notes->setText(RsHtml().formatText(NULL, QString::fromUtf8(mPost.mNotes.c_str()), RSHTML_FORMATTEXT_EMBED_SMILEYS | RSHTML_FORMATTEXT_EMBED_LINKS));