summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Smith <git@kismith.co.uk>2009-08-26 22:23:31 (GMT)
committerKevin Smith <git@kismith.co.uk>2009-08-26 22:23:31 (GMT)
commita7e67d1185c18d890d77f4bfaa079252bbd43c2d (patch)
tree75c2db3e8e1d80a522152abc9601e38861312d21 /Swift/QtUI/Roster
parent0087712586d5651e1fe8fe9e76b2e8cff3b1f602 (diff)
downloadswift-a7e67d1185c18d890d77f4bfaa079252bbd43c2d.zip
swift-a7e67d1185c18d890d77f4bfaa079252bbd43c2d.tar.bz2
Gradient the group headers in the roster.
Diffstat (limited to 'Swift/QtUI/Roster')
-rw-r--r--Swift/QtUI/Roster/RosterDelegate.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/Swift/QtUI/Roster/RosterDelegate.cpp b/Swift/QtUI/Roster/RosterDelegate.cpp
index 1b7857e..2abace2 100644
--- a/Swift/QtUI/Roster/RosterDelegate.cpp
+++ b/Swift/QtUI/Roster/RosterDelegate.cpp
@@ -46,8 +46,11 @@ void RosterDelegate::paint(QPainter* painter, const QStyleOptionViewItem& option
void RosterDelegate::paintGroup(QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index) const {
painter->save();
- //QLinearGradient
- QBrush backgroundBrush = QBrush(index.data(Qt::BackgroundColorRole).value<QColor>(), Qt::SolidPattern);
+ QLinearGradient fillGradient(option.rect.topLeft(), option.rect.bottomLeft());
+ fillGradient.setColorAt(0, QColor(200, 200, 200));
+ fillGradient.setColorAt(0.5, QColor(150, 150, 150));
+ fillGradient.setColorAt(1, QColor(200, 200, 200));
+ QBrush backgroundBrush = QBrush(fillGradient);
painter->setPen(QPen(index.data(Qt::TextColorRole).value<QColor>()));
QPainterPath roundedPath;
roundedPath.addRoundedRect(option.rect, 5, 5);