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

* Experiment with now playing item's colors.

This commit is contained in:
Christian Muehlhaeuser 2012-12-08 22:14:36 +01:00
parent bee3f18fbe
commit 52a30ea0bd
4 changed files with 6 additions and 7 deletions

@ -206,9 +206,7 @@ PlaylistItemDelegate::paintShort( QPainter* painter, const QStyleOptionViewItem&
painter->drawText( r.adjusted( 0, 1, 0, 0 ), text, m_topOption );
painter->setFont( opt.font );
if ( option.state & QStyle::State_Selected )
painter->setPen( option.palette.color( QPalette::HighlightedText ) );
else
if ( !( option.state & QStyle::State_Selected || item->isPlaying() ) )
painter->setPen( Qt::gray );
text = painter->fontMetrics().elidedText( lowerText, Qt::ElideRight, r.width() );

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

@ -721,10 +721,10 @@ prepareStyleOption( QStyleOptionViewItemV4* option, const QModelIndex& index, Pl
if ( item->isPlaying() )
{
option->palette.setColor( QPalette::Highlight, option->palette.color( QPalette::Mid ) );
option->palette.setColor( QPalette::Highlight, TomahawkUtils::Colors::NOW_PLAYING_ITEM.lighter() );
option->backgroundBrush = TomahawkUtils::Colors::NOW_PLAYING_ITEM;
option->backgroundBrush = option->palette.color( QPalette::Mid );
option->palette.setColor( QPalette::Text, option->palette.color( QPalette::Text ) );
option->palette.setColor( QPalette::Text, Qt::white );
}

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