mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-07-31 19:30:21 +02:00
Paint proper text color in tree item delegate
This commit is contained in:
@@ -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 );
|
||||
|
Reference in New Issue
Block a user