diff options
author | Kevin Smith <git@kismith.co.uk> | 2010-08-27 13:59:58 (GMT) |
---|---|---|
committer | Kevin Smith <git@kismith.co.uk> | 2010-08-27 13:59:58 (GMT) |
commit | 02e1f82cd154030ea44608d90c7241a0ba8c1795 (patch) | |
tree | 82227a1ac31b651fc43559eeec648d2b47a7c622 /Swift/QtUI/QtElidingLabel.cpp | |
parent | 0571ecb72660dbdbe06d524eb62e5398dca45586 (diff) | |
download | swift-02e1f82cd154030ea44608d90c7241a0ba8c1795.zip swift-02e1f82cd154030ea44608d90c7241a0ba8c1795.tar.bz2 |
Don't elide roster headings when the widget becomes large enough.
Resolves: #544
Diffstat (limited to 'Swift/QtUI/QtElidingLabel.cpp')
-rw-r--r-- | Swift/QtUI/QtElidingLabel.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Swift/QtUI/QtElidingLabel.cpp b/Swift/QtUI/QtElidingLabel.cpp index 475aa3b..3d53006 100644 --- a/Swift/QtUI/QtElidingLabel.cpp +++ b/Swift/QtUI/QtElidingLabel.cpp @@ -38,9 +38,12 @@ void QtElidingLabel::paintEvent(QPaintEvent* event) { dirty_ = dirty_ || rect != lastRect_; if (dirty_) { lastRect_ = rect; - if (fontMetrics().width(fullText_) > rect.width()) { + int fontWidth = fontMetrics().width(fullText_); + if (fontWidth > rect.width()) { QString elidedText(fontMetrics().elidedText(fullText_, Qt::ElideRight, rect.width(), Qt::TextShowMnemonic)); QLabel::setText(elidedText); + } else { + QLabel::setText(fullText_); } dirty_ = false; } |