Use moveBottom instead of setBottom so that the images are all lined up at the bottom.
This commit is contained in:
parent
6bbe54a7fd
commit
e787a35330
1 changed files with 3 additions and 8 deletions
|
@ -118,21 +118,18 @@ namespace Danbooru {
|
||||||
|
|
||||||
// Scaling is unavoidable to keep things in the right dimension
|
// Scaling is unavoidable to keep things in the right dimension
|
||||||
|
|
||||||
QPixmap scaled = pixmap.scaled(rect.width() - MARGIN,
|
QPixmap scaled = pixmap.scaled(rect.width() - MARGIN, rect.height() - MARGIN,
|
||||||
rect.height() - MARGIN,
|
|
||||||
Qt::KeepAspectRatio,
|
Qt::KeepAspectRatio,
|
||||||
Qt::SmoothTransformation);
|
Qt::SmoothTransformation);
|
||||||
|
|
||||||
QRect pixRect = scaled.rect();
|
QRect pixRect = scaled.rect();
|
||||||
pixRect.moveCenter(rect.center());
|
pixRect.moveCenter(rect.center());
|
||||||
|
|
||||||
// painter->drawRect(option.rect);
|
|
||||||
|
|
||||||
// move the pixmap up to accomodate some lines of text
|
// move the pixmap up to accomodate some lines of text
|
||||||
|
|
||||||
pixRect.moveTo(pixRect.left(),
|
pixRect.moveTo(pixRect.left(),
|
||||||
pixRect.top() + textRect.height() / 2);
|
pixRect.top() - textRect.height() / 2);
|
||||||
pixRect.setBottom(textRect.top() - MARGIN);
|
pixRect.moveBottom(textRect.top() - MARGIN);
|
||||||
|
|
||||||
painter->drawPixmap(pixRect, scaled);
|
painter->drawPixmap(pixRect, scaled);
|
||||||
painter->restore();
|
painter->restore();
|
||||||
|
@ -232,8 +229,6 @@ namespace Danbooru {
|
||||||
if (post) {
|
if (post) {
|
||||||
Q_EMIT(postDownloadRequested(post->fileUrl()));
|
Q_EMIT(postDownloadRequested(post->fileUrl()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void DanbooruPostDelegate::viewButtonClicked()
|
void DanbooruPostDelegate::viewButtonClicked()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue