mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-05 13:47:26 +02:00
Removed avatar of last peer who played a track from Recently Played.
This fixes TWK-1132.
This commit is contained in:
@@ -122,14 +122,12 @@ PlaylistLargeItemDelegate::paint( QPainter* painter, const QStyleOptionViewItem&
|
|||||||
const QString album = q->album();
|
const QString album = q->album();
|
||||||
const QString track = q->track();
|
const QString track = q->track();
|
||||||
int duration = q->duration();
|
int duration = q->duration();
|
||||||
QPixmap avatar;
|
|
||||||
QString lowerText;
|
QString lowerText;
|
||||||
|
|
||||||
QSize avatarSize( 32, 32 );
|
QSize avatarSize( 32, 32 );
|
||||||
source_ptr source = item->query()->playedBy().first;
|
source_ptr source = item->query()->playedBy().first;
|
||||||
if ( m_mode == RecentlyPlayed && !source.isNull() )
|
if ( m_mode == RecentlyPlayed && !source.isNull() )
|
||||||
{
|
{
|
||||||
avatar = source->avatar( TomahawkUtils::RoundedCorners, avatarSize );
|
|
||||||
QString playtime = TomahawkUtils::ageToString( QDateTime::fromTime_t( item->query()->playedBy().second ), true );
|
QString playtime = TomahawkUtils::ageToString( QDateTime::fromTime_t( item->query()->playedBy().second ), true );
|
||||||
|
|
||||||
if ( source == SourceList::instance()->getLocal() )
|
if ( source == SourceList::instance()->getLocal() )
|
||||||
@@ -178,9 +176,6 @@ PlaylistLargeItemDelegate::paint( QPainter* painter, const QStyleOptionViewItem&
|
|||||||
const QPixmap pixmap = m_pixmaps[ index ]->currentPixmap();
|
const QPixmap pixmap = m_pixmaps[ index ]->currentPixmap();
|
||||||
painter->drawPixmap( pixmapRect, pixmap );
|
painter->drawPixmap( pixmapRect, pixmap );
|
||||||
|
|
||||||
if ( !avatar.isNull() )
|
|
||||||
painter->drawPixmap( avatarRect, avatar );
|
|
||||||
|
|
||||||
QFont boldFont = opt.font;
|
QFont boldFont = opt.font;
|
||||||
boldFont.setPointSize( TomahawkUtils::defaultFontSize() + 2 );
|
boldFont.setPointSize( TomahawkUtils::defaultFontSize() + 2 );
|
||||||
boldFont.setWeight( 99 );
|
boldFont.setWeight( 99 );
|
||||||
@@ -195,7 +190,7 @@ PlaylistLargeItemDelegate::paint( QPainter* painter, const QStyleOptionViewItem&
|
|||||||
QFont smallFont = opt.font;
|
QFont smallFont = opt.font;
|
||||||
smallFont.setPointSize( TomahawkUtils::defaultFontSize() - 1 );
|
smallFont.setPointSize( TomahawkUtils::defaultFontSize() - 1 );
|
||||||
|
|
||||||
r.adjust( pixmapRect.width() + 12, 1, - 16 - avatar.width(), 0 );
|
r.adjust( pixmapRect.width() + 12, 1, - 16, 0 );
|
||||||
QRect leftRect = r.adjusted( 0, 0, -48, 0 );
|
QRect leftRect = r.adjusted( 0, 0, -48, 0 );
|
||||||
QRect rightRect = r.adjusted( r.width() - smallBoldFontMetrics.width( TomahawkUtils::timeToString( duration ) ), 0, 0, 0 );
|
QRect rightRect = r.adjusted( r.width() - smallBoldFontMetrics.width( TomahawkUtils::timeToString( duration ) ), 0, 0, 0 );
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user