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
 | 
			
		||||
 | 
			
		||||
        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()
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue