mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-03-21 08:19:42 +01:00
Paint proper text color in tree item delegate
This commit is contained in:
parent
50267afe06
commit
9ca97d2e1a
@ -80,10 +80,16 @@ TreeItemDelegate::paint( QPainter* painter, const QStyleOptionViewItem& option,
|
||||
QStyleOptionViewItemV4 o( *vioption );
|
||||
o.palette.setColor( QPalette::Text, textColor );
|
||||
|
||||
if ( o.state & QStyle::State_Selected && o.state & QStyle::State_Active )
|
||||
{
|
||||
o.palette.setColor( QPalette::Text, o.palette.color( QPalette::HighlightedText ) );
|
||||
}
|
||||
|
||||
if ( item->isPlaying() )
|
||||
{
|
||||
o.palette.setColor( QPalette::Highlight, o.palette.color( QPalette::Mid ) );
|
||||
o.palette.setColor( QPalette::Text, o.palette.color( QPalette::HighlightedText ) );
|
||||
if ( o.state & QStyle::State_Selected )
|
||||
o.palette.setColor( QPalette::Text, textColor );
|
||||
o.state |= QStyle::State_Selected;
|
||||
}
|
||||
|
||||
@ -100,6 +106,7 @@ TreeItemDelegate::paint( QPainter* painter, const QStyleOptionViewItem& option,
|
||||
r.adjust( 25, 0, 0, 3 );
|
||||
}
|
||||
|
||||
|
||||
painter->setPen( o.palette.text().color() );
|
||||
|
||||
QTextOption to( Qt::AlignVCenter );
|
||||
|
Loading…
x
Reference in New Issue
Block a user