mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-05 05:37:29 +02:00
* Less work for SourceDelegate now.
This commit is contained in:
@@ -186,17 +186,10 @@ SourceDelegate::paintCollection( QPainter* painter, const QStyleOptionViewItem&
|
|||||||
QString text = painter->fontMetrics().elidedText( name, Qt::ElideRight, textRect.width() );
|
QString text = painter->fontMetrics().elidedText( name, Qt::ElideRight, textRect.width() );
|
||||||
painter->drawText( textRect, text );
|
painter->drawText( textRect, text );
|
||||||
|
|
||||||
bool isPlaying = false;
|
bool isPlaying = !( colItem->source()->currentTrack().isNull() );
|
||||||
QString desc = status ? colItem->source()->textStatus() : tr( "Offline" );
|
QString desc = colItem->source()->textStatus();
|
||||||
if ( colItem->source().isNull() )
|
if ( colItem->source().isNull() )
|
||||||
desc = tr( "All available tracks" );
|
desc = tr( "All available tracks" );
|
||||||
if ( status && desc.isEmpty() && !colItem->source()->currentTrack().isNull() )
|
|
||||||
{
|
|
||||||
desc = colItem->source()->currentTrack()->artist() + " - " + colItem->source()->currentTrack()->track();
|
|
||||||
isPlaying = true;
|
|
||||||
}
|
|
||||||
if ( desc.isEmpty() )
|
|
||||||
desc = tr( "Online" );
|
|
||||||
|
|
||||||
painter->setFont( normal );
|
painter->setFont( normal );
|
||||||
textRect = option.rect.adjusted( iconRect.width() + 8, option.rect.height() / 2, -figWidth - 24, -6 );
|
textRect = option.rect.adjusted( iconRect.width() + 8, option.rect.height() / 2, -figWidth - 24, -6 );
|
||||||
|
Reference in New Issue
Block a user