From e787a35330855ff39bfa05f048fda0ba4f48386a Mon Sep 17 00:00:00 2001 From: Luca Beltrame Date: Sun, 21 Jul 2013 09:44:05 +0200 Subject: [PATCH] Use moveBottom instead of setBottom so that the images are all lined up at the bottom. --- src/model/danboorupostdelegate.cpp | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/model/danboorupostdelegate.cpp b/src/model/danboorupostdelegate.cpp index 27107fc..3f74e3f 100644 --- a/src/model/danboorupostdelegate.cpp +++ b/src/model/danboorupostdelegate.cpp @@ -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()