mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-07 06:36:55 +02:00
Tweak color of source description text in the sources tree.
This handles some stuff from TWK-1141.
This commit is contained in:
@@ -191,6 +191,7 @@ SourceDelegate::paintCollection( QPainter* painter, const QStyleOptionViewItem&
|
|||||||
|
|
||||||
bool isPlaying = !( colItem->source()->currentTrack().isNull() );
|
bool isPlaying = !( colItem->source()->currentTrack().isNull() );
|
||||||
QString desc = colItem->source()->textStatus();
|
QString desc = colItem->source()->textStatus();
|
||||||
|
QColor descColor = QColor( "#8d8d8d" );
|
||||||
if ( colItem->source().isNull() )
|
if ( colItem->source().isNull() )
|
||||||
desc = tr( "All available tracks" );
|
desc = tr( "All available tracks" );
|
||||||
|
|
||||||
@@ -249,6 +250,9 @@ SourceDelegate::paintCollection( QPainter* painter, const QStyleOptionViewItem&
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
m_lockRects.remove( index );
|
m_lockRects.remove( index );
|
||||||
|
|
||||||
|
if ( isPlaying )
|
||||||
|
descColor = Qt::black;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( m_trackHovered == index )
|
if ( m_trackHovered == index )
|
||||||
@@ -261,6 +265,7 @@ SourceDelegate::paintCollection( QPainter* painter, const QStyleOptionViewItem&
|
|||||||
text = painter->fontMetrics().elidedText( desc, Qt::ElideRight, textRect.width() - 8 );
|
text = painter->fontMetrics().elidedText( desc, Qt::ElideRight, textRect.width() - 8 );
|
||||||
QTextOption to( Qt::AlignVCenter );
|
QTextOption to( Qt::AlignVCenter );
|
||||||
to.setWrapMode( QTextOption::NoWrap );
|
to.setWrapMode( QTextOption::NoWrap );
|
||||||
|
painter->setPen( descColor );
|
||||||
painter->drawText( textRect, text, to );
|
painter->drawText( textRect, text, to );
|
||||||
|
|
||||||
if ( colItem->source() && colItem->source()->currentTrack() )
|
if ( colItem->source() && colItem->source()->currentTrack() )
|
||||||
|
Reference in New Issue
Block a user