File indexing completed on 2024-04-28 05:50:39

0001 /*
0002     SPDX-FileCopyrightText: 2007-2008 Robert Knight <robertknight@gmail.com>
0003     SPDX-FileCopyrightText: 2018 Harald Sitter <sitter@kde.org>
0004 
0005     SPDX-License-Identifier: GPL-2.0-or-later
0006 */
0007 
0008 #ifndef COLORSCHEMEVIEWDELEGATE_H
0009 #define COLORSCHEMEVIEWDELEGATE_H
0010 
0011 #include <QAbstractItemDelegate>
0012 
0013 #include <functional>
0014 
0015 namespace Konsole
0016 {
0017 /**
0018  * A delegate which can display and edit color schemes in a view.
0019  */
0020 class ColorSchemeViewDelegate : public QAbstractItemDelegate
0021 {
0022     Q_OBJECT
0023 
0024 public:
0025     explicit ColorSchemeViewDelegate(std::function<bool()> compositingActiveHelper, QObject *parent = nullptr);
0026 
0027     // reimplemented
0028     void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override;
0029     QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const override;
0030 
0031 private:
0032     std::function<bool()> m_compositingActive;
0033 };
0034 
0035 }
0036 
0037 #endif