Pith - wedge_linux
wedge_linux/WedgeHighlighter.h [1.1 kb]
Modified: 22:03:59 118 026 (15 Jul 026)
10 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
Wedge - Android 126.026
Wedge - Linux 124.026
Shim - Android 117.026
Miter - 114.026
Kerf - Android 112.026
Dev
TVShow (227) 'CSA'
TVShow (228) 'APT'
TVProgram (83) 'BXT'
Miter Update(s)
Peen (Messaging)

Menu
Calendar
Project Tin (024/029)
Miter
RSS Feed