Merge pull request #2674 from Umcaruje/elidefxtext

Elide channel names to prevent text overflow in FxLine
This commit is contained in:
Umcaruje
2016-03-17 22:47:31 +01:00

View File

@@ -152,7 +152,11 @@ void FxLine::drawFxLine( QPainter* p, const FxLine *fxLine, const QString& name,
// draw the channel name
if( m_staticTextName.text() != name )
{
m_staticTextName.setText( name );
// elide the name of the fxLine when its too long
const int maxTextHeight = 78;
QFontMetrics metrics( fxLine->font() );
QString elidedName = metrics.elidedText( name, Qt::ElideRight, maxTextHeight );
m_staticTextName.setText( elidedName );
}
p->rotate( -90 );