From 990462ddaeb4d7fbb5e655dcd1d76f802f2263e9 Mon Sep 17 00:00:00 2001 From: Michael Zanetti Date: Thu, 19 Jul 2012 00:39:41 +0200 Subject: [PATCH] fix the drag'n drop menu for scaled dpis --- src/sourcetree/SourceDelegate.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/sourcetree/SourceDelegate.cpp b/src/sourcetree/SourceDelegate.cpp index c8981cf83..564c172ce 100644 --- a/src/sourcetree/SourceDelegate.cpp +++ b/src/sourcetree/SourceDelegate.cpp @@ -99,7 +99,6 @@ SourceDelegate::sizeHint( const QStyleOptionViewItem& option, const QModelIndex& } else if ( type == SourcesModel::Group ) { -// return QSize( option.rect.width(), 26 ); int groupSpacer = index.row() > 0 ? option.fontMetrics.height() * 0.6 : option.fontMetrics.height() * 0.2; return QSize( option.rect.width(), option.fontMetrics.height() + groupSpacer ); } @@ -108,8 +107,8 @@ SourceDelegate::sizeHint( const QStyleOptionViewItem& option, const QModelIndex& if ( !m_expandedMap.value( index )->initialized() ) { int dropTypes = dropTypeCount( item ); - QSize originalSize = QStyledItemDelegate::sizeHint( option, index ); - QSize targetSize = originalSize + QSize( 0, dropTypes == 0 ? 0 : 56 ); + QSize originalSize = QSize( option.rect.width(), option.fontMetrics.height() * 1.2 ); + QSize targetSize = originalSize + QSize( 0, dropTypes == 0 ? 0 : 38 + option.fontMetrics.height() * 1.2 ); m_expandedMap.value( index )->initialize( originalSize, targetSize, 300 ); m_expandedMap.value( index )->expand(); }