From 849917cb0039447d7bbebcafb9ac8bd9f2879f1b Mon Sep 17 00:00:00 2001 From: Teo Mrnjavac Date: Sat, 19 Oct 2013 15:29:03 +0200 Subject: [PATCH] Play with small text shade in PlaylistLargeItemDelegate --- src/libtomahawk/playlist/PlaylistLargeItemDelegate.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/libtomahawk/playlist/PlaylistLargeItemDelegate.cpp b/src/libtomahawk/playlist/PlaylistLargeItemDelegate.cpp index ffd92058d..7d3e9ecb2 100644 --- a/src/libtomahawk/playlist/PlaylistLargeItemDelegate.cpp +++ b/src/libtomahawk/playlist/PlaylistLargeItemDelegate.cpp @@ -189,7 +189,15 @@ PlaylistLargeItemDelegate::paint( QPainter* painter, const QStyleOptionViewItem& textDoc.setDefaultTextOption( m_topOption ); if ( !( option.state & QStyle::State_Selected || item->isPlaying() ) ) - painter->setPen( opt.palette.mid().color() ); + { + QColor mid = opt.palette.mid().color(); + //HACK: adjust small text shade based on a guess if normal text is darker or lighter + // than normal background. + if ( opt.palette.text().color().lightness() < opt.palette.base().color().lightness() ) + painter->setPen( mid.darker( 140 ) ); + else + painter->setPen( mid.lighter( 140 ) ); + } if ( textDoc.idealWidth() <= leftRect.width() ) drawRichText( painter, opt, leftRect.adjusted( 0, QFontMetrics( bigBoldFont ).height() + 1, 0, 0 ), Qt::AlignTop, textDoc );