1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-10 16:14:40 +02:00

remove styleoption selected before painting the text to avoid two selection boxes

This commit is contained in:
Michael Zanetti
2011-08-24 00:06:09 +02:00
parent 9cc919eb08
commit 39af693de1

View File

@@ -173,14 +173,16 @@ SourceDelegate::paint( QPainter* painter, const QStyleOptionViewItem& option, co
}
else if ( type == SourcesModel::StaticPlaylist || type == SourcesModel::CategoryAdd )
{
o.state &= QStyle::State_Selected;
o.showDecorationSelected = false;
if ( !m_expandedMap.contains( index) )
{
QStyledItemDelegate::paint( painter, option, index );
QStyledItemDelegate::paint( painter, o, index );
return;
}
// Let Qt paint the original item. We add our stuff after it
QStyleOptionViewItem o = option;
// QStyleOptionViewItem o = option;
o.rect.adjust( 0, 0, 0, - option.rect.height() + m_expandedMap.value( index )->originalSize().height() );
QStyledItemDelegate::paint( painter, o, index );