mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-11-08 02:53:25 -08:00
* [Client] Active pill for alts table, dismissed pill for report queue * Apply suggestion from @ZeldaZach Co-authored-by: Zach H <zahalpern+github@gmail.com> --------- Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de> Co-authored-by: Zach H <zahalpern+github@gmail.com>
22 lines
828 B
C++
22 lines
828 B
C++
#ifndef REPORT_STATUS_DELEGATE_H
|
|
#define REPORT_STATUS_DELEGATE_H
|
|
|
|
#include <QStyledItemDelegate>
|
|
#include <qtmetamacros.h>
|
|
|
|
/**
|
|
* Status pill for the report queue table. Paints the status text on a
|
|
* translucent badge tinted with a palette role per status (open, assigned,
|
|
* resolved, dismissed), so the colors always follow the active theme.
|
|
* Falls back to default painting for selected rows and unknown statuses.
|
|
*/
|
|
class ReportStatusDelegate : public QStyledItemDelegate
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
explicit ReportStatusDelegate(QObject *parent = nullptr);
|
|
void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override;
|
|
[[nodiscard]] QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const override;
|
|
};
|
|
|
|
#endif // REPORT_STATUS_DELEGATE_H
|