diff options
author | Kevin Smith <git@kismith.co.uk> | 2010-05-26 21:24:39 (GMT) |
---|---|---|
committer | Kevin Smith <git@kismith.co.uk> | 2010-05-26 21:24:39 (GMT) |
commit | 8d697d9aa2f07a3222dea561174f063c382449f1 (patch) | |
tree | 5206c4927231f608d1ed50609fa5a361b1fa7b77 /Swift/QtUI/QtRosterHeader.cpp | |
parent | d65ae35e1e14c15c5ae9106e37254b163307934d (diff) | |
download | swift-contrib-8d697d9aa2f07a3222dea561174f063c382449f1.zip swift-contrib-8d697d9aa2f07a3222dea561174f063c382449f1.tar.bz2 |
Make better use of the elided text labels.
Cache the elided text to avoid recalculating and making the QLabel
superclass recalculate everything. Also using plaintext with a font
instead of richtext means that it doesn't have to deal with truncated
html tags.
Hopefully
Resolves: #398
Diffstat (limited to 'Swift/QtUI/QtRosterHeader.cpp')
-rw-r--r-- | Swift/QtUI/QtRosterHeader.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/Swift/QtUI/QtRosterHeader.cpp b/Swift/QtUI/QtRosterHeader.cpp index 5c89e2a..0270a5e 100644 --- a/Swift/QtUI/QtRosterHeader.cpp +++ b/Swift/QtUI/QtRosterHeader.cpp @@ -41,6 +41,9 @@ QtRosterHeader::QtRosterHeader(QWidget* parent) : QWidget(parent) { nameLabel_ = new QtElidingLabel(this); setName("Me"); + QFont font = nameLabel_->font(); + font.setBold(true); + nameLabel_->setFont(font); rightLayout->addWidget(nameLabel_); @@ -92,7 +95,8 @@ void QtRosterHeader::setName(const QString& name) { name_ = name; QString escapedName = name_; escapedName.replace("<","<"); - nameLabel_->setText("<b>" + escapedName + "</b>"); +// nameLabel_->setText("<b>" + escapedName + "</b>"); + nameLabel_->setText(escapedName); // resizeNameLabel(); } |