X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fuisupport%2Fuistyle.h;fp=src%2Fuisupport%2Fuistyle.h;h=28ba40546973366102107800e0c413dfd429a50a;hp=7d1a8bcd285414d4b2565e12b431f943aa233749;hb=e6f810169117c836c22ae1146e469e61dec95f6f;hpb=ac7a58dd970833da2336f6ce035ec55515bac0f1 diff --git a/src/uisupport/uistyle.h b/src/uisupport/uistyle.h index 7d1a8bcd..28ba4054 100644 --- a/src/uisupport/uistyle.h +++ b/src/uisupport/uistyle.h @@ -23,6 +23,7 @@ #include #include +#include #include #include #include @@ -158,6 +159,8 @@ public: struct Format { FormatType type; + QColor foreground; + QColor background; }; using FormatList = std::vector>; @@ -242,7 +245,7 @@ public: */ static QString timestampFormatString(); - QTextCharFormat format(FormatType formatType, MessageLabel messageLabel) const; + QTextCharFormat format(const Format &format, MessageLabel messageLabel) const; QFontMetricsF *fontMetrics(FormatType formatType, MessageLabel messageLabel) const; QList toTextLayoutList(const FormatList &, int textLength, MessageLabel messageLabel) const; @@ -264,10 +267,10 @@ protected: QString loadStyleSheet(const QString &name, bool shouldExist = false); QTextCharFormat format(quint64 key) const; - QTextCharFormat cachedFormat(FormatType formatType, MessageLabel messageLabel) const; - void setCachedFormat(const QTextCharFormat &format, FormatType formatType, MessageLabel messageLabel) const; - void mergeFormat(QTextCharFormat &format, FormatType formatType, MessageLabel messageLabel) const; - void mergeSubElementFormat(QTextCharFormat &format, FormatType formatType, MessageLabel messageLabel) const; + QTextCharFormat cachedFormat(const Format &format, MessageLabel messageLabel) const; + void setCachedFormat(const QTextCharFormat &charFormat, const Format &format, MessageLabel messageLabel) const; + void mergeFormat(QTextCharFormat &charFormat, const Format &format, MessageLabel messageLabel) const; + void mergeSubElementFormat(QTextCharFormat &charFormat, FormatType formatType, MessageLabel messageLabel) const; static FormatType formatType(const QString &code); static QString formatCode(FormatType); @@ -319,7 +322,7 @@ private: QVector _uiStylePalette; QBrush _markerLineBrush; QHash _formats; - mutable QHash _formatCache; + mutable QHash _formatCache; mutable QHash _metricsCache; QHash _listItemFormats; static QHash _formatCodes;