elide completion entries in the middle

The completion list did show the URLs as right-elided entries,
which is not optimal.
For filenames and man pages at least middle-elide is much more sensible.
BUG: 111821
FIXED-IN: 4.9.1
REVIEW: 106183
This commit is contained in:
Martin Koller 2012-08-26 12:21:39 +02:00
parent 38fda3bf75
commit dffa8b2aee

View file

@ -799,7 +799,7 @@ void KonqComboItemDelegate::paint( QPainter *painter, const QStyleOptionViewItem
const QRect urlRect = QStyle::alignedRect( option.direction, Qt::AlignLeft, urlSize, textRect );
if ( !url.isEmpty() ) {
QString squeezedText = option.fontMetrics.elidedText( url, Qt::ElideRight, urlRect.width() );
QString squeezedText = option.fontMetrics.elidedText( url, Qt::ElideMiddle, urlRect.width() );
painter->drawText( urlRect, Qt::AlignLeft | Qt::AlignVCenter, squeezedText );
}