summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Smith <git@kismith.co.uk>2010-08-27 13:59:58 (GMT)
committerKevin Smith <git@kismith.co.uk>2010-08-27 13:59:58 (GMT)
commit02e1f82cd154030ea44608d90c7241a0ba8c1795 (patch)
tree82227a1ac31b651fc43559eeec648d2b47a7c622 /Swift/QtUI/QtElidingLabel.cpp
parent0571ecb72660dbdbe06d524eb62e5398dca45586 (diff)
downloadswift-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.cpp5
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;
}