| 1 | // SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd. |
|---|---|
| 2 | // |
| 3 | // SPDX-License-Identifier: GPL-3.0-or-later |
| 4 | |
| 5 | #ifndef CODELENSDELEGATE_H |
| 6 | #define CODELENSDELEGATE_H |
| 7 | |
| 8 | #include "common/common.h" |
| 9 | |
| 10 | #include <QObject> |
| 11 | #include <QStyledItemDelegate> |
| 12 | |
| 13 | class CodeLensDelegate : public QStyledItemDelegate |
| 14 | { |
| 15 | Q_OBJECT |
| 16 | int characterStart; |
| 17 | int characterEnd; |
| 18 | QColor color; |
| 19 | public: |
| 20 | explicit CodeLensDelegate(QObject *parent = nullptr); |
| 21 | void paint(QPainter *painter, const QStyleOptionViewItem &option, |
| 22 | const QModelIndex &index) const override; |
| 23 | void setHeightColor(const QColor &color); |
| 24 | void setHeightRange(int characterStart, int characterEnd); |
| 25 | }; |
| 26 | |
| 27 | #endif // CODELENSDELEGATE_H |
| 28 |