1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-03-24 09:49:42 +01:00

* Never wrap text in sidebar.

This commit is contained in:
Christian Muehlhaeuser 2013-04-16 10:39:27 +02:00
parent b76f40e67b
commit 81dc2fe1fa

View File

@ -229,7 +229,11 @@ SourceDelegate::paintCollection( QPainter* painter, const QStyleOptionViewItem&
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 );
{
QTextOption to;
to.setWrapMode( QTextOption::NoWrap );
painter->drawText( textRect, text, to );
}
QColor descColor = option.palette.color( QPalette::HighlightedText ).lighter( 220 );
if ( type == SourcesModel::ScriptCollection && //you cannot select a non-script collection anyway
@ -312,10 +316,12 @@ SourceDelegate::paintCollection( QPainter* painter, const QStyleOptionViewItem&
}
textRect.adjust( 0, 0, 0, 2 );
text = painter->fontMetrics().elidedText( desc, Qt::ElideRight, textRect.width() - 8 );
QTextOption to( Qt::AlignVCenter );
to.setWrapMode( QTextOption::NoWrap );
painter->setPen( descColor );
painter->drawText( textRect, text, to );
{
QTextOption to( Qt::AlignVCenter );
to.setWrapMode( QTextOption::NoWrap );
painter->setPen( descColor );
painter->drawText( textRect, text, to );
}
bool shouldPaintTrackCount = false;
if ( type == SourcesModel::Collection )