mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-05 13:47:26 +02:00
* Elide source names earlier.
This commit is contained in:
@@ -180,7 +180,7 @@ 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 - 24, 0 );
|
QRect textRect = option.rect.adjusted( iconRect.width() + 8, 6, -figWidth - 28, 0 );
|
||||||
if ( status || colItem->source().isNull() )
|
if ( status || colItem->source().isNull() )
|
||||||
painter->setFont( bold );
|
painter->setFont( bold );
|
||||||
QString text = painter->fontMetrics().elidedText( name, Qt::ElideRight, textRect.width() );
|
QString text = painter->fontMetrics().elidedText( name, Qt::ElideRight, textRect.width() );
|
||||||
@@ -241,7 +241,7 @@ SourceDelegate::paintCollection( QPainter* painter, const QStyleOptionViewItem&
|
|||||||
}
|
}
|
||||||
|
|
||||||
textRect.adjust( 0, 0, 0, 2 );
|
textRect.adjust( 0, 0, 0, 2 );
|
||||||
text = painter->fontMetrics().elidedText( desc, Qt::ElideRight, textRect.width() - 4 );
|
text = painter->fontMetrics().elidedText( desc, Qt::ElideRight, textRect.width() - 8 );
|
||||||
QTextOption to( Qt::AlignVCenter );
|
QTextOption to( Qt::AlignVCenter );
|
||||||
to.setWrapMode( QTextOption::NoWrap );
|
to.setWrapMode( QTextOption::NoWrap );
|
||||||
painter->drawText( textRect, text, to );
|
painter->drawText( textRect, text, to );
|
||||||
|
Reference in New Issue
Block a user