@ 261105.1
current
/***************************************************************************
                               themeswatchdelegate.h
                             -------------------
    begin                : 2026
    copyright            : (C) 2009-2026 by Andre Simon
    email                : a.simon@mailbox.org
 ***************************************************************************/

/*
This file is part of Highlight.

Highlight is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

Highlight is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with Highlight.  If not, see <http://www.gnu.org/licenses/>.
*/

#ifndef THEMESWATCHDELEGATE_H
#define THEMESWATCHDELEGATE_H

#include <QStyledItemDelegate>

/** Paints a theme of ThemeListModel as a card with a small code-like
    colour swatch and the theme name below */
class ThemeSwatchDelegate : public QStyledItemDelegate
{
    Q_OBJECT

public:
    explicit ThemeSwatchDelegate(QObject *parent = nullptr);

    void paint(QPainter *painter, const QStyleOptionViewItem &option,
               const QModelIndex &index) const override;
    QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const override;

    static constexpr int CardWidth = 150;
    static constexpr int SwatchHeight = 60;
};

#endif // THEMESWATCHDELEGATE_H