mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-13 17:43:59 +02:00
Display the source resolver icon in the default playlist view
This commit is contained in:
@@ -218,7 +218,7 @@ PlaylistLargeItemDelegate::paint( QPainter* painter, const QStyleOptionViewItem&
|
||||
QFont smallFont = opt.font;
|
||||
smallFont.setPointSize( TomahawkUtils::defaultFontSize() - 2 );
|
||||
|
||||
r.adjust( pixmapRect.width() + 12, 1, -28 - avatar.width(), 0 );
|
||||
r.adjust( pixmapRect.width() + 12, 1, - 20 - avatar.width(), 0 );
|
||||
QRect leftRect = r.adjusted( 0, 0, -48, 0 );
|
||||
QRect rightRect = r.adjusted( r.width() - smallBoldFontMetrics.width( TomahawkUtils::timeToString( duration ) ), 0, 0, 0 );
|
||||
|
||||
@@ -243,6 +243,16 @@ PlaylistLargeItemDelegate::paint( QPainter* painter, const QStyleOptionViewItem&
|
||||
|
||||
drawRichText( painter, option, leftRect, Qt::AlignBottom, textDoc );
|
||||
|
||||
if ( !q->results().isEmpty() && !q->results().first()->sourceIcon().isNull() )
|
||||
{
|
||||
const int iconSize = avatarRect.width() - 4;
|
||||
const QPixmap sourceIcon = q->results().first()->sourceIcon( QSize( iconSize, iconSize ) );
|
||||
painter->setOpacity( 0.8 );
|
||||
painter->drawPixmap( QRect( rightRect.right() - iconSize, r.center().y() - iconSize/2, iconSize, iconSize ), sourceIcon );
|
||||
painter->setOpacity( 1. );
|
||||
rightRect.moveLeft( rightRect.left() - iconSize - 8 );
|
||||
}
|
||||
|
||||
if ( duration > 0 )
|
||||
{
|
||||
painter->setPen( opt.palette.text().color() );
|
||||
|
Reference in New Issue
Block a user