RetroShare/retroshare-gui/src/gui/ChanGroupDelegate.cpp
thunder2 e20e9a529a Add spacing again for forums, messages and channels.
Added a new base class "RSItemDelegate" for adding a spacing for the item and remove the focus rectangle of the empty text for items with only an icon.
Removed existing classes "ForumsItemDelegate" and "MessagesItemDelegate".

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@3771 b45a01b8-16f6-495d-af2f-9b41ad6348cc
2010-11-09 23:56:02 +00:00

28 lines
637 B
C++

/*
* ChanGroupDelegate.cpp
*
* Created on: Sep 7, 2009
* Author: alex
*/
#include "ChanGroupDelegate.h"
#include <QApplication>
#include <QPainter>
#include <QColor>
ChanGroupDelegate::ChanGroupDelegate(QObject *parent) : RSItemDelegate(parent)
{
}
void ChanGroupDelegate::paint(QPainter * painter, const QStyleOptionViewItem & option, const QModelIndex & index) const
{
if (index.child(0, 0).isValid()) {
painter->setPen(Qt::blue);
QStyleOptionButton opt;
opt.rect = option.rect;
QApplication::style()->drawControl(QStyle::CE_PushButtonBevel, &opt, painter);
}
RSItemDelegate::paint(painter, option, index);
}