diff options
author | Tobias Markmann <tm@ayena.de> | 2013-10-12 08:58:45 (GMT) |
---|---|---|
committer | Tobias Markmann <tm@ayena.de> | 2013-10-12 12:21:15 (GMT) |
commit | 092c5edea4290db0be22f26898e483d9e39be8cc (patch) | |
tree | 309c4ee17b702d8dc61c800fbbb624a2caea1484 /Swift | |
parent | c2833f8afa8db40cfebfe51ecf5bb42fd87d8dca (diff) | |
download | swift-092c5edea4290db0be22f26898e483d9e39be8cc.zip swift-092c5edea4290db0be22f26898e483d9e39be8cc.tar.bz2 |
Clip rendering of text in DelegateCommons.
Ensure that text rendering bugs on some unicode characters (e.g. U+0E47, U+0E49)
don't spill outside the indented drawing region.
Change-Id: Ia6683c943d90adb572b6072b037a4e0886ac068c
License: This patch is BSD-licensed, see Documentation/Licenses/BSD-simplified.txt for details.
Diffstat (limited to 'Swift')
-rw-r--r-- | Swift/QtUI/Roster/DelegateCommons.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Swift/QtUI/Roster/DelegateCommons.cpp b/Swift/QtUI/Roster/DelegateCommons.cpp index e7342f3..776d90c 100644 --- a/Swift/QtUI/Roster/DelegateCommons.cpp +++ b/Swift/QtUI/Roster/DelegateCommons.cpp @@ -14,7 +14,9 @@ namespace Swift { void DelegateCommons::drawElidedText(QPainter* painter, const QRect& region, const QString& text, int flags) { QString adjustedText(painter->fontMetrics().elidedText(text, Qt::ElideRight, region.width(), Qt::TextShowMnemonic)); + painter->setClipRect(region); painter->drawText(region, flags, adjustedText.simplified()); + painter->setClipping(false); } void DelegateCommons::paintContact(QPainter* painter, const QStyleOptionViewItem& option, const QColor& nameColor, const QString& avatarPath, const QIcon& presenceIcon, const QString& name, const QString& statusText, bool isIdle, int unreadCount, bool compact) const { |