summaryrefslogtreecommitdiffstats
blob: 712af81aa4a78c59050152f212058b607f6f44b8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#pragma once

#include <QStyledItemDelegate>
#include <QColor>
#include <QFont>

namespace Swift {
	class QtTreeWidgetItem;
	class RosterDelegate : public QStyledItemDelegate {
	public:
		RosterDelegate();
		QSize sizeHint(const QStyleOptionViewItem& option, const QModelIndex& index) const;
		void paint(QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index) const;
	private:
		QSize groupSizeHint(const QStyleOptionViewItem& option, const QModelIndex& index) const;
		QSize contactSizeHint(const QStyleOptionViewItem& option, const QModelIndex& index) const;
		void paintGroup(QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index) const; 
		void paintContact(QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index) const; 
		QFont nameFont_;
		QFont statusFont_;
		QFont groupFont_;
		static const int avatarSize_;
		static const int presenceIconHeight_;
		static const int presenceIconWidth_;
		static const int groupCornerRadius_;
		static const int horizontalMargin_;
		static const int verticalMargin_ ;
		static const int farLeftMargin_;
	};
}