fixed layout of compact view to use a constant apsect ratio with cropping

This commit is contained in:
csoler 2020-09-30 21:35:30 +02:00
parent d3cb789fcd
commit 5c240c6abb
6 changed files with 100 additions and 61 deletions

View file

@ -99,6 +99,8 @@ void PostedPostDelegate::paint(QPainter * painter, const QStyleOptionViewItem &
BoardPostDisplayWidget_compact w(post,displayFlags(post.mMeta.mMsgId),nullptr);
w.setFixedSize(option.rect.size());
w.updateGeometry();
w.adjustSize();
w.render(&pixmap,QPoint(0,0),QRegion(),QWidget::DrawChildren );// draw the widgets, not the background
}
@ -107,6 +109,7 @@ void PostedPostDelegate::paint(QPainter * painter, const QStyleOptionViewItem &
BoardPostDisplayWidget_card w(post,displayFlags(post.mMeta.mMsgId),nullptr);
w.setFixedSize(option.rect.size());
w.updateGeometry();
w.adjustSize();
w.render(&pixmap,QPoint(0,0),QRegion(),QWidget::DrawChildren );// draw the widgets, not the background
}
@ -198,6 +201,8 @@ QWidget *PostedPostDelegate::createEditor(QWidget *parent, const QStyleOptionVie
w->setFixedSize(option.rect.size());
w->adjustSize();
w->updateGeometry();
w->adjustSize();
return w;
}