Add custom image functionality for inline mod buttons. (#5369)

Co-authored-by: Rasmus Karlsson <rasmus.karlsson@pajlada.com>
This commit is contained in:
Mm2PL
2024-05-11 12:54:27 +02:00
committed by GitHub
parent 321d881bfe
commit c3b84cb4b6
15 changed files with 396 additions and 89 deletions
+19
View File
@@ -0,0 +1,19 @@
#pragma once
#include <QStyledItemDelegate>
namespace chatterino {
/**
* IconDelegate draws the decoration role pixmap scaled down to a square icon
*/
class IconDelegate : public QStyledItemDelegate
{
public:
explicit IconDelegate(QObject *parent = nullptr);
void paint(QPainter *painter, const QStyleOptionViewItem &option,
const QModelIndex &index) const override;
};
} // namespace chatterino