From 6fd839c237de0760418b635f44ca98cd7a9729db Mon Sep 17 00:00:00 2001 From: Christian Muehlhaeuser Date: Wed, 20 Jun 2012 17:23:58 +0200 Subject: [PATCH] * Elide source names earlier. --- src/sourcetree/SourceDelegate.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/sourcetree/SourceDelegate.cpp b/src/sourcetree/SourceDelegate.cpp index 1f434a924..389329017 100644 --- a/src/sourcetree/SourceDelegate.cpp +++ b/src/sourcetree/SourceDelegate.cpp @@ -180,7 +180,7 @@ SourceDelegate::paintCollection( QPainter* painter, const QStyleOptionViewItem& painter->setPen( option.palette.color( QPalette::HighlightedText ) ); } - QRect textRect = option.rect.adjusted( iconRect.width() + 8, 6, -figWidth - 24, 0 ); + QRect textRect = option.rect.adjusted( iconRect.width() + 8, 6, -figWidth - 28, 0 ); if ( status || colItem->source().isNull() ) painter->setFont( bold ); QString text = painter->fontMetrics().elidedText( name, Qt::ElideRight, textRect.width() ); @@ -241,7 +241,7 @@ SourceDelegate::paintCollection( QPainter* painter, const QStyleOptionViewItem& } textRect.adjust( 0, 0, 0, 2 ); - text = painter->fontMetrics().elidedText( desc, Qt::ElideRight, textRect.width() - 4 ); + text = painter->fontMetrics().elidedText( desc, Qt::ElideRight, textRect.width() - 8 ); QTextOption to( Qt::AlignVCenter ); to.setWrapMode( QTextOption::NoWrap ); painter->drawText( textRect, text, to );