From d97a530ee53f73d26a9f6b7f5f69f96f5960c354 Mon Sep 17 00:00:00 2001 From: Teo Mrnjavac Date: Sun, 17 Feb 2013 13:26:57 +0100 Subject: [PATCH] Fix description elision. --- 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 b6f5dc19e..a3b54702e 100644 --- a/src/sourcetree/SourceDelegate.cpp +++ b/src/sourcetree/SourceDelegate.cpp @@ -219,14 +219,14 @@ SourceDelegate::paintCollection( QPainter* painter, const QStyleOptionViewItem& painter->setPen( option.palette.color( QPalette::HighlightedText ) ); } - QRect textRect = option.rect.adjusted( iconRect.width() + 8, 6, -figWidth - 28, 0 ); + QRect textRect = option.rect.adjusted( iconRect.width() + 8, 6, -figWidth - ( figWidth ? 28 : 0 ), 0 ); QString text = painter->fontMetrics().elidedText( name, Qt::ElideRight, textRect.width() ); painter->drawText( textRect, text ); QColor descColor = QColor( "#8d8d8d" ); painter->setFont( normal ); - textRect = option.rect.adjusted( iconRect.width() + 8, option.rect.height() / 2, -figWidth - 24, -6 ); + textRect = option.rect.adjusted( iconRect.width() + 8, option.rect.height() / 2, -figWidth - ( figWidth ? 24 : 0 ), -6 ); if ( type == SourcesModel::Collection ) {