Skip to content

Commit a81b14b

Browse files
Handle cases where elided text becomes empty or "..."
Render the whole text if the elided text becomes empty or if it only contains one character, i.e. if it becomes "…". Solved as implemented because I was not able to check for "…" explicitly, i.e. the comparison against "…" still failed.
1 parent f15fe18 commit a81b14b

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/core/Track.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -656,6 +656,11 @@ void TrackContentObjectView::paintTextLabel(QString const & text, QPainter & pai
656656
QFontMetrics fontMetrics(labelFont);
657657
QString elidedPatternName = fontMetrics.elidedText(text, Qt::ElideMiddle, width() - 2 * textLeft);
658658

659+
if (elidedPatternName.length() < 2)
660+
{
661+
elidedPatternName = text.trimmed();
662+
}
663+
659664
painter.fillRect(QRect(0, 0, width(), fontMetrics.height() + 2 * textTop), textBackgroundColor());
660665

661666
painter.setPen( textColor() );

0 commit comments

Comments
 (0)