Pith - wedge_linux
wedge_linux/WedgeHighlighter.h [1.1 kb]
Modified: 22:03:59 118 026 (15 Jul 026)
45 Days Ago
#ifndef WEDGEHIGHLIGHTER_H
#define WEDGEHIGHLIGHTER_H

#include <QColor>
#include <QString>
#include <QSyntaxHighlighter>
#include <QTextCharFormat>

class WedgeHighlighter : public QSyntaxHighlighter {
public:
    WedgeHighlighter(QTextDocument *parent, const QColor &focusColor, const QColor &highlightColor, const QColor &textColor, const QString &headerFormat)
        : QSyntaxHighlighter(parent), m_focusColor(focusColor), m_highlightColor(highlightColor), m_textColor(textColor), m_headerFormat(headerFormat) {}

    void setColors(const QColor &focusColor, const QColor &highlightColor, const QColor &textColor) {
        m_focusColor = focusColor;
        m_highlightColor = highlightColor;
        m_textColor = textColor;
        rehighlight();
    }

    void setHeaderFormat(const QString &headerFormat) {
        if (m_headerFormat == headerFormat) return;
        m_headerFormat = headerFormat;
        rehighlight();
    }

protected:
    void highlightBlock(const QString &text) override;

private:
    QColor m_focusColor;
    QColor m_highlightColor;
    QColor m_textColor;
    QString m_headerFormat;
};

#endif
Updates
Stave - Android 158.026
Kerf - Android 157.026
Kiln - Android 157.026
Wedge - Android 156.026
Whittle - Linux 155.026

Menu
Calendar
Project Tin (024/029)
Miter
RSS Feed
User Avatar
@vgmlr
=SUM(parts)
0.00151
260,192 (+606)