1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-04-20 07:52:30 +02:00

fix font shrinking issue on OSX with the dragndrop menu

This commit is contained in:
Michael Zanetti 2011-08-24 08:36:32 +02:00
parent 52037d8847
commit 9f6dd0a104

View File

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