1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-08 07:07:05 +02:00

* Never word-wrap in the short-mode PlaylistItemDelegate.

This commit is contained in:
Christian Muehlhaeuser
2011-06-23 17:42:52 +02:00
parent dca4a7c591
commit 1a4ed2e551

View File

@@ -202,13 +202,14 @@ PlaylistItemDelegate::paintShort( QPainter* painter, const QStyleOptionViewItem&
r.adjust( ir.width() + 12, 0, 0, 0 ); r.adjust( ir.width() + 12, 0, 0, 0 );
QTextOption to( Qt::AlignTop ); QTextOption to( Qt::AlignTop );
QString text = painter->fontMetrics().elidedText( upperText, Qt::ElideRight, r.width() - 3 ); to.setWrapMode( QTextOption::NoWrap );
painter->setFont( boldFont ); painter->setFont( boldFont );
QString text = painter->fontMetrics().elidedText( upperText, Qt::ElideRight, r.width() - 3 );
painter->drawText( r.adjusted( 0, 1, 0, 0 ), text, to ); painter->drawText( r.adjusted( 0, 1, 0, 0 ), text, to );
to.setAlignment( Qt::AlignBottom ); to.setAlignment( Qt::AlignBottom );
text = painter->fontMetrics().elidedText( lowerText, Qt::ElideRight, r.width() - 3 );
painter->setFont( opt.font ); painter->setFont( opt.font );
text = painter->fontMetrics().elidedText( lowerText, Qt::ElideRight, r.width() - 3 );
painter->drawText( r.adjusted( 0, 1, 0, 0 ), text, to ); painter->drawText( r.adjusted( 0, 1, 0, 0 ), text, to );
} }
painter->restore(); painter->restore();