summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Smith <git@kismith.co.uk>2010-06-26 19:21:31 (GMT)
committerKevin Smith <git@kismith.co.uk>2010-06-26 19:21:31 (GMT)
commitde7ee8e38a2dfaab9fde40a7916c8212f5859d68 (patch)
treec2b8b07ea10b81fb52fef9cbb79f57a52589e657 /Swift/QtUI/Roster/DelegateCommons.cpp
parent53f132042a6d470f94a9721a31c86514aba11c4f (diff)
downloadswift-de7ee8e38a2dfaab9fde40a7916c8212f5859d68.zip
swift-de7ee8e38a2dfaab9fde40a7916c8212f5859d68.tar.bz2
Elide text in the various roster views.
Resolves: #426
Diffstat (limited to 'Swift/QtUI/Roster/DelegateCommons.cpp')
-rw-r--r--Swift/QtUI/Roster/DelegateCommons.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/Swift/QtUI/Roster/DelegateCommons.cpp b/Swift/QtUI/Roster/DelegateCommons.cpp
index 3cd3695..164b80f 100644
--- a/Swift/QtUI/Roster/DelegateCommons.cpp
+++ b/Swift/QtUI/Roster/DelegateCommons.cpp
@@ -7,7 +7,18 @@
#include "DelegateCommons.h"
namespace Swift {
+
+
+void DelegateCommons::drawElidedText(QPainter* painter, const QRect& region, const QString& text) {
+ QString adjustedText(painter->fontMetrics().elidedText(text, Qt::ElideRight, region.width(), Qt::TextShowMnemonic));
+ painter->drawText(region, Qt::AlignTop, adjustedText);
+}
+
+
const int DelegateCommons::horizontalMargin = 2;
const int DelegateCommons::verticalMargin = 2;
const int DelegateCommons::farLeftMargin = 2;
+
+
+
}