1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-03-25 02:09:48 +01:00

Tweak color of source description text in the sources tree.

This handles some stuff from TWK-1141.
This commit is contained in:
Teo Mrnjavac 2012-12-22 23:28:09 +01:00
parent b43d3ea989
commit 7885c2fadb

View File

@ -191,6 +191,7 @@ SourceDelegate::paintCollection( QPainter* painter, const QStyleOptionViewItem&
bool isPlaying = !( colItem->source()->currentTrack().isNull() );
QString desc = colItem->source()->textStatus();
QColor descColor = QColor( "#8d8d8d" );
if ( colItem->source().isNull() )
desc = tr( "All available tracks" );
@ -249,6 +250,9 @@ SourceDelegate::paintCollection( QPainter* painter, const QStyleOptionViewItem&
}
else
m_lockRects.remove( index );
if ( isPlaying )
descColor = Qt::black;
}
if ( m_trackHovered == index )
@ -261,6 +265,7 @@ SourceDelegate::paintCollection( QPainter* painter, const QStyleOptionViewItem&
text = painter->fontMetrics().elidedText( desc, Qt::ElideRight, textRect.width() - 8 );
QTextOption to( Qt::AlignVCenter );
to.setWrapMode( QTextOption::NoWrap );
painter->setPen( descColor );
painter->drawText( textRect, text, to );
if ( colItem->source() && colItem->source()->currentTrack() )