1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-07-31 11:20:22 +02:00

Fix description elision.

This commit is contained in:
Teo Mrnjavac
2013-02-17 13:26:57 +01:00
parent 13b5a3c911
commit d97a530ee5

View File

@@ -219,14 +219,14 @@ SourceDelegate::paintCollection( QPainter* painter, const QStyleOptionViewItem&
painter->setPen( option.palette.color( QPalette::HighlightedText ) ); 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() ); QString text = painter->fontMetrics().elidedText( name, Qt::ElideRight, textRect.width() );
painter->drawText( textRect, text ); painter->drawText( textRect, text );
QColor descColor = QColor( "#8d8d8d" ); QColor descColor = QColor( "#8d8d8d" );
painter->setFont( normal ); 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 ) if ( type == SourcesModel::Collection )
{ {