From 7885c2fadb4ef7d5b14eae6024e7fe72b998e145 Mon Sep 17 00:00:00 2001 From: Teo Mrnjavac Date: Sat, 22 Dec 2012 23:28:09 +0100 Subject: [PATCH] Tweak color of source description text in the sources tree. This handles some stuff from TWK-1141. --- src/sourcetree/SourceDelegate.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/sourcetree/SourceDelegate.cpp b/src/sourcetree/SourceDelegate.cpp index 58d2f23f4..cf994fb94 100644 --- a/src/sourcetree/SourceDelegate.cpp +++ b/src/sourcetree/SourceDelegate.cpp @@ -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() )