Use moveBottom instead of setBottom so that the images are all lined up at the bottom.

This commit is contained in:
Luca Beltrame 2013-07-21 09:44:05 +02:00
parent 6bbe54a7fd
commit e787a35330

View file

@ -118,21 +118,18 @@ namespace Danbooru {
// Scaling is unavoidable to keep things in the right dimension
QPixmap scaled = pixmap.scaled(rect.width() - MARGIN,
rect.height() - MARGIN,
QPixmap scaled = pixmap.scaled(rect.width() - MARGIN, rect.height() - MARGIN,
Qt::KeepAspectRatio,
Qt::SmoothTransformation);
QRect pixRect = scaled.rect();
pixRect.moveCenter(rect.center());
// painter->drawRect(option.rect);
// move the pixmap up to accomodate some lines of text
pixRect.moveTo(pixRect.left(),
pixRect.top() + textRect.height() / 2);
pixRect.setBottom(textRect.top() - MARGIN);
pixRect.top() - textRect.height() / 2);
pixRect.moveBottom(textRect.top() - MARGIN);
painter->drawPixmap(pixRect, scaled);
painter->restore();
@ -232,8 +229,6 @@ namespace Danbooru {
if (post) {
Q_EMIT(postDownloadRequested(post->fileUrl()));
}
}
void DanbooruPostDelegate::viewButtonClicked()