mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-15 18:44:30 +02:00
remove styleoption selected before painting the text to avoid two selection boxes
This commit is contained in:
@@ -173,14 +173,16 @@ SourceDelegate::paint( QPainter* painter, const QStyleOptionViewItem& option, co
|
|||||||
}
|
}
|
||||||
else if ( type == SourcesModel::StaticPlaylist || type == SourcesModel::CategoryAdd )
|
else if ( type == SourcesModel::StaticPlaylist || type == SourcesModel::CategoryAdd )
|
||||||
{
|
{
|
||||||
|
o.state &= QStyle::State_Selected;
|
||||||
|
o.showDecorationSelected = false;
|
||||||
if ( !m_expandedMap.contains( index) )
|
if ( !m_expandedMap.contains( index) )
|
||||||
{
|
{
|
||||||
QStyledItemDelegate::paint( painter, option, index );
|
QStyledItemDelegate::paint( painter, o, index );
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Let Qt paint the original item. We add our stuff after it
|
// 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() );
|
o.rect.adjust( 0, 0, 0, - option.rect.height() + m_expandedMap.value( index )->originalSize().height() );
|
||||||
QStyledItemDelegate::paint( painter, o, index );
|
QStyledItemDelegate::paint( painter, o, index );
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user