1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-03-20 15:59:42 +01:00

* Make sure we always set our custom foreground color on now-playing items.

This commit is contained in:
Christian Muehlhaeuser 2012-12-08 22:20:45 +01:00
parent 52a30ea0bd
commit 1842c2b77b
3 changed files with 6 additions and 7 deletions

View File

@ -84,9 +84,9 @@ TreeItemDelegate::paint( QPainter* painter, const QStyleOptionViewItem& option,
if ( item->isPlaying() )
{
textColor = TomahawkUtils::Colors::NOW_PLAYING_ITEM_TEXT;
o.palette.setColor( QPalette::Highlight, TomahawkUtils::Colors::NOW_PLAYING_ITEM );
if ( o.state & QStyle::State_Selected )
o.palette.setColor( QPalette::Text, textColor );
o.palette.setColor( QPalette::Text, TomahawkUtils::Colors::NOW_PLAYING_ITEM_TEXT );
o.state |= QStyle::State_Selected;
}

View File

@ -721,14 +721,12 @@ prepareStyleOption( QStyleOptionViewItemV4* option, const QModelIndex& index, Pl
if ( item->isPlaying() )
{
option->palette.setColor( QPalette::Highlight, TomahawkUtils::Colors::NOW_PLAYING_ITEM.lighter() );
option->backgroundBrush = TomahawkUtils::Colors::NOW_PLAYING_ITEM;
option->palette.setColor( QPalette::Text, Qt::white );
option->palette.setColor( QPalette::Highlight, TomahawkUtils::Colors::NOW_PLAYING_ITEM.lighter() );
option->palette.setColor( QPalette::Text, TomahawkUtils::Colors::NOW_PLAYING_ITEM_TEXT );
}
if ( option->state & QStyle::State_Selected && !item->isPlaying() )
else if ( option->state & QStyle::State_Selected )
{
option->palette.setColor( QPalette::Text, option->palette.color( QPalette::HighlightedText ) );
}

View File

@ -83,6 +83,7 @@ namespace TomahawkUtils
static const QColor POPUP_BACKGROUND = QColor( "#ffffff" );
static const QColor GROUP_HEADER = QColor( "#637180" );
static const QColor NOW_PLAYING_ITEM = QColor( "#962c26" );
static const QColor NOW_PLAYING_ITEM_TEXT = QColor( "#ffffff" );
}
static const int POPUP_ROUNDING_RADIUS = 6;