From 9f6dd0a10404bc7f0267d67b81cf6f5a0b902b25 Mon Sep 17 00:00:00 2001 From: Michael Zanetti Date: Wed, 24 Aug 2011 08:36:32 +0200 Subject: [PATCH] fix font shrinking issue on OSX with the dragndrop menu --- src/sourcetree/sourcedelegate.cpp | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/src/sourcetree/sourcedelegate.cpp b/src/sourcetree/sourcedelegate.cpp index 55b41dfc6..7c500dd7b 100644 --- a/src/sourcetree/sourcedelegate.cpp +++ b/src/sourcetree/sourcedelegate.cpp @@ -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