mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-07-31 11:20:22 +02:00
* Experiment with now playing item's colors.
This commit is contained in:
@@ -206,9 +206,7 @@ PlaylistItemDelegate::paintShort( QPainter* painter, const QStyleOptionViewItem&
|
|||||||
painter->drawText( r.adjusted( 0, 1, 0, 0 ), text, m_topOption );
|
painter->drawText( r.adjusted( 0, 1, 0, 0 ), text, m_topOption );
|
||||||
|
|
||||||
painter->setFont( opt.font );
|
painter->setFont( opt.font );
|
||||||
if ( option.state & QStyle::State_Selected )
|
if ( !( option.state & QStyle::State_Selected || item->isPlaying() ) )
|
||||||
painter->setPen( option.palette.color( QPalette::HighlightedText ) );
|
|
||||||
else
|
|
||||||
painter->setPen( Qt::gray );
|
painter->setPen( Qt::gray );
|
||||||
|
|
||||||
text = painter->fontMetrics().elidedText( lowerText, Qt::ElideRight, r.width() );
|
text = painter->fontMetrics().elidedText( lowerText, Qt::ElideRight, r.width() );
|
||||||
|
@@ -84,7 +84,7 @@ TreeItemDelegate::paint( QPainter* painter, const QStyleOptionViewItem& option,
|
|||||||
|
|
||||||
if ( item->isPlaying() )
|
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 )
|
if ( o.state & QStyle::State_Selected )
|
||||||
o.palette.setColor( QPalette::Text, textColor );
|
o.palette.setColor( QPalette::Text, textColor );
|
||||||
o.state |= QStyle::State_Selected;
|
o.state |= QStyle::State_Selected;
|
||||||
|
@@ -721,10 +721,10 @@ prepareStyleOption( QStyleOptionViewItemV4* option, const QModelIndex& index, Pl
|
|||||||
|
|
||||||
if ( item->isPlaying() )
|
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, Qt::white );
|
||||||
option->palette.setColor( QPalette::Text, option->palette.color( QPalette::Text ) );
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -82,6 +82,7 @@ namespace TomahawkUtils
|
|||||||
static const QColor BORDER_LINE = QColor( "#8c8c8c" );
|
static const QColor BORDER_LINE = QColor( "#8c8c8c" );
|
||||||
static const QColor POPUP_BACKGROUND = QColor( "#ffffff" );
|
static const QColor POPUP_BACKGROUND = QColor( "#ffffff" );
|
||||||
static const QColor GROUP_HEADER = QColor( "#637180" );
|
static const QColor GROUP_HEADER = QColor( "#637180" );
|
||||||
|
static const QColor NOW_PLAYING_ITEM = QColor( "#962c26" );
|
||||||
}
|
}
|
||||||
|
|
||||||
static const int POPUP_ROUNDING_RADIUS = 6;
|
static const int POPUP_ROUNDING_RADIUS = 6;
|
||||||
|
Reference in New Issue
Block a user