Cockatrice/cockatrice/src/interface/widgets/tabs/report_status_delegate.h
BruebachL 2b4019ccaf
[Client] Active pill for alts table, dismissed pill for report queue (#7519)
* [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>
2026-11-08 09:01:11 +01:00

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