summaryrefslogtreecommitdiffstats
path: root/Swift
diff options
context:
space:
mode:
authorKevin Smith <git@kismith.co.uk>2009-08-27 18:15:23 (GMT)
committerKevin Smith <git@kismith.co.uk>2009-08-27 18:15:23 (GMT)
commite3a0b04ad6aaf62144dc9aa3b825d42390cc0477 (patch)
treeaeabb67b353a8029494e7ec188ee0c67c88775d0 /Swift
parent87a1041bbaf6e8031ec3894d71a8296d15bd96ed (diff)
downloadswift-e3a0b04ad6aaf62144dc9aa3b825d42390cc0477.zip
swift-e3a0b04ad6aaf62144dc9aa3b825d42390cc0477.tar.bz2
Render first group header flush with the top of the roster.
Diffstat (limited to 'Swift')
-rw-r--r--Swift/QtUI/Roster/RosterDelegate.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/Swift/QtUI/Roster/RosterDelegate.cpp b/Swift/QtUI/Roster/RosterDelegate.cpp
index af9f23c..a26dd19 100644
--- a/Swift/QtUI/Roster/RosterDelegate.cpp
+++ b/Swift/QtUI/Roster/RosterDelegate.cpp
@@ -58,7 +58,7 @@ void RosterDelegate::paintGroup(QPainter* painter, const QStyleOptionViewItem& o
painter->setPen(QPen(QColor(189, 189, 189)));
//FIXME: It looks like Qt is passing us a rectangle that's too small
//This deliberately draws outside the lines, and we need to find a better solution.
- QRect region(QPoint(option.rect.left() - 1, option.rect.top() + verticalMargin_), QSize(option.rect.width() + 1, option.rect.height() - 2 * verticalMargin_));
+ QRect region(QPoint(option.rect.left() - 1, option.rect.top()), QSize(option.rect.width() + 1, option.rect.height() - verticalMargin_));
QLinearGradient fillGradient(region.topLeft(), region.bottomLeft());
fillGradient.setColorAt(0, QColor(244, 244, 244));
fillGradient.setColorAt(0.1, QColor(231, 231, 231));
@@ -94,11 +94,11 @@ void RosterDelegate::paintContact(QPainter* painter, const QStyleOptionViewItem&
painter->setPen(QPen(nameColor));
}
- QRect presenceIconRegion(QPoint(farLeftMargin_, fullRegion.top()), QSize(presenceIconWidth_, fullRegion.height()));
+ QRect presenceIconRegion(QPoint(farLeftMargin_, fullRegion.top()), QSize(presenceIconWidth_, fullRegion.height() - verticalMargin_));
- int calculatedAvatarSize = fullRegion.height() - 2 * verticalMargin_;
+ int calculatedAvatarSize = presenceIconRegion.height();
//This overlaps the presenceIcon, so must be painted first
- QRect avatarRegion(QPoint(presenceIconRegion.right() - presenceIconWidth_ / 2, fullRegion.top() + verticalMargin_), QSize(calculatedAvatarSize, calculatedAvatarSize));
+ QRect avatarRegion(QPoint(presenceIconRegion.right() - presenceIconWidth_ / 2, presenceIconRegion.top()), QSize(calculatedAvatarSize, calculatedAvatarSize));
QIcon avatar = index.data(AvatarRole).isValid() && !index.data(AvatarRole).value<QIcon>().isNull()
? index.data(AvatarRole).value<QIcon>()
: QIcon(":/icons/avatar.png");
@@ -133,7 +133,7 @@ const int RosterDelegate::presenceIconHeight_ = 16;
const int RosterDelegate::presenceIconWidth_ = 16;
const int RosterDelegate::groupCornerRadius_ = 0;
const int RosterDelegate::horizontalMargin_ = 2;
-const int RosterDelegate::verticalMargin_ = 1;
+const int RosterDelegate::verticalMargin_ = 2;
const int RosterDelegate::farLeftMargin_ = 2;
} \ No newline at end of file