Changeset View
Changeset View
Standalone View
Standalone View
libs/widgets/KisPaletteDelegate.h
- This file was moved from libs/widgets/kis_palette_delegate.h.
Context not available. | |||||
26 | 26 | | |||
---|---|---|---|---|---|
27 | class KRITAWIDGETS_EXPORT KisPaletteDelegate : public QAbstractItemDelegate | 27 | class KRITAWIDGETS_EXPORT KisPaletteDelegate : public QAbstractItemDelegate | ||
28 | { | 28 | { | ||
29 | private: | ||||
30 | static const int BORDER_WIDTH; | ||||
29 | public: | 31 | public: | ||
30 | KisPaletteDelegate(QObject * parent = 0); | 32 | KisPaletteDelegate(QObject * parent = 0); | ||
31 | ~KisPaletteDelegate() override; | 33 | ~KisPaletteDelegate() override; | ||
32 | 34 | | |||
33 | void setCrossedKeyword(const QString &value); | 35 | void setCrossedKeyword(const QString &value) | ||
36 | { | ||||
37 | m_crossedKeyword = value; | ||||
38 | } | ||||
34 | 39 | | |||
35 | void paint(QPainter *, const QStyleOptionViewItem &, const QModelIndex &) const override; | 40 | void paint(QPainter *, const QStyleOptionViewItem &, const QModelIndex &) const override; | ||
36 | QSize sizeHint(const QStyleOptionViewItem & option, const QModelIndex &) const override; | 41 | QSize sizeHint(const QStyleOptionViewItem & option, const QModelIndex &) const override; | ||
37 | 42 | | |||
43 | void paintSwatch() const; | ||||
44 | | ||||
38 | private: | 45 | private: | ||
39 | QString m_crossedKeyword; | 46 | QString m_crossedKeyword; | ||
47 | void paintCrossedLine(const QStyleOptionViewItem &option, QPainter *painter) const; | ||||
48 | void paintNonCrossed(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index, const bool isSelected) const; | ||||
49 | void paintGroupName(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index, const bool isSelected) const; | ||||
40 | }; | 50 | }; | ||
41 | 51 | | |||
42 | #endif /* __KIS_PALETTE_DELEGATE_H */ | 52 | #endif /* __KIS_PALETTE_DELEGATE_H */ | ||
Context not available. |