1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-03-20 07:49:42 +01:00

Smaller rows, and paint icon a bit bigger

This commit is contained in:
Leo Franchi 2011-09-20 13:23:10 -04:00
parent 92fb2dbb0d
commit af19a09a3c

View File

@ -24,7 +24,8 @@
#include <QPainter>
#include <QApplication>
#define ROW_HEIGHT 20
#define ROW_HEIGHT 15
#define ICON_PADDING 1
#define PADDING 2
JobStatusDelegate::JobStatusDelegate( QObject* parent )
: QStyledItemDelegate ( parent )
@ -51,7 +52,7 @@ JobStatusDelegate::paint( QPainter* painter, const QStyleOptionViewItem& option,
// painter->drawLine( opt.rect.topLeft(), opt.rect.topRight() );
painter->setRenderHint( QPainter::Antialiasing );
const QRect iconRect( PADDING, PADDING + opt.rect.y(), ROW_HEIGHT - 2*PADDING, ROW_HEIGHT - 2*PADDING );
const QRect iconRect( ICON_PADDING, ICON_PADDING + opt.rect.y(), ROW_HEIGHT - 2*ICON_PADDING, ROW_HEIGHT - 2*ICON_PADDING );
QPixmap p = index.data( Qt::DecorationRole ).value< QPixmap >();
p = p.scaled( iconRect.size(), Qt::KeepAspectRatio, Qt::SmoothTransformation );
painter->drawPixmap( iconRect, p );