-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFileListViewDelegate.h
More file actions
31 lines (26 loc) · 933 Bytes
/
FileListViewDelegate.h
File metadata and controls
31 lines (26 loc) · 933 Bytes
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
31
#ifndef FILELISTVIEWDELEGATE_H
#define FILELISTVIEWDELEGATE_H
#include <QStyledItemDelegate>
#include <QStyleOptionViewItem>
#include <QPen>
class Config;
class Theme;
class FileFilterModel;
class FileListViewDelegate : public QStyledItemDelegate
{
public:
FileListViewDelegate(Config* config, Theme* theme, FileFilterModel* fileFilterModel, QWidget* parent);
virtual ~FileListViewDelegate() override;
void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override;
QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const override;
private:
Config* _config;
Theme* _theme;
FileFilterModel* _fileFilterModel;
QBrush _backgroundBrush;
QBrush _borderBrush;
QBrush _selectionBrush;
QPen _textPen;
void _drawPixmap(QPainter *p, QPixmap* pixmap, QRect &rect, bool border) const;
};
#endif // FILELISTVIEWDELEGATE_H