mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-07 06:36:55 +02:00
* Make ClickableLabel auto-elide.
This commit is contained in:
@@ -94,5 +94,7 @@ ClickableLabel::paintEvent( QPaintEvent* event )
|
|||||||
{
|
{
|
||||||
QPainter painter( this );
|
QPainter painter( this );
|
||||||
painter.setOpacity( m_opacity );
|
painter.setOpacity( m_opacity );
|
||||||
painter.drawText( contentsRect(), text() );
|
|
||||||
|
const QString elidedText = fontMetrics().elidedText( text(), Qt::ElideRight, contentsRect().width() );
|
||||||
|
painter.drawText( contentsRect(), alignment(), elidedText );
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user