diff options
author | Remko Tronçon <git@el-tramo.be> | 2010-10-31 09:45:28 (GMT) |
---|---|---|
committer | Remko Tronçon <git@el-tramo.be> | 2010-10-31 09:45:28 (GMT) |
commit | bd55796d134b45400a76dcfdc0b97dd233bb0f86 (patch) | |
tree | fa18351efe07141f0cbf326dd7fe4f51d360a6f0 | |
parent | 85a80452ca28ed82183fabb847ec39a2bd47dac9 (diff) | |
download | swift-contrib-bd55796d134b45400a76dcfdc0b97dd233bb0f86.zip swift-contrib-bd55796d134b45400a76dcfdc0b97dd233bb0f86.tar.bz2 |
Don't clip group header text.
Resolves: #659
-rw-r--r-- | Swift/QtUI/Roster/GroupItemDelegate.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Swift/QtUI/Roster/GroupItemDelegate.cpp b/Swift/QtUI/Roster/GroupItemDelegate.cpp index 9be3c37..819352d 100644 --- a/Swift/QtUI/Roster/GroupItemDelegate.cpp +++ b/Swift/QtUI/Roster/GroupItemDelegate.cpp @@ -8,6 +8,7 @@ #include <QPainter> #include <QPen> +#include <QtDebug> namespace Swift { @@ -18,7 +19,7 @@ GroupItemDelegate::GroupItemDelegate() : groupFont_(QApplication::font()) { QSize GroupItemDelegate::sizeHint(const QStyleOptionViewItem& /*option*/, const QModelIndex& /*index*/) const { QFontMetrics groupMetrics(groupFont_); - return QSize(150, groupMetrics.height() + 4); + return QSize(150, groupMetrics.height() + common_.verticalMargin + 2); } void GroupItemDelegate::paint(QPainter* painter, const QStyleOptionViewItem& option, const QString& name, int rowCount, bool expanded) const { @@ -47,7 +48,7 @@ void GroupItemDelegate::paint(QPainter* painter, const QStyleOptionViewItem& opt int textLeftOffset = 3 * common_.horizontalMargin + 1 + triangleWidth; QFontMetrics fontMetrics(groupFont_); - int textTopOffset = (option.rect.height() - fontMetrics.height()) / 2; + int textTopOffset = (region.height() - fontMetrics.height()) / 2; painter->setFont(groupFont_); int contactCountWidth = 0; QRect textRect = region.adjusted(textLeftOffset, textTopOffset, -1 * textLeftOffset, -1 * textTopOffset); |