static QString mircToInternal(const QString &);
static inline QString timestampFormatString() { return _timestampFormatString; }
- QTextCharFormat format(quint32 formatType, quint32 messageLabel);
- QFontMetricsF *fontMetrics(quint32 formatType, quint32 messageLabel);
+ QTextCharFormat format(quint32 formatType, quint32 messageLabel) const;
+ QFontMetricsF *fontMetrics(quint32 formatType, quint32 messageLabel) const;
- QList<QTextLayout::FormatRange> toTextLayoutList(const FormatList &, int textLength, quint32 messageLabel);
+ QList<QTextLayout::FormatRange> toTextLayoutList(const FormatList &, int textLength, quint32 messageLabel) const;
inline const QBrush &brush(ColorRole role) const { return _uiStylePalette.at((int) role); }
inline void setBrush(ColorRole role, const QBrush &brush) { _uiStylePalette[(int) role] = brush; }
QTextCharFormat format(quint64 key) const;
QTextCharFormat cachedFormat(quint32 formatType, quint32 messageLabel) const;
- void setCachedFormat(const QTextCharFormat &format, quint32 formatType, quint32 messageLabel);
- void mergeFormat(QTextCharFormat &format, quint32 formatType, quint64 messageLabel);
- void mergeSubElementFormat(QTextCharFormat &format, quint32 formatType, quint64 messageLabel);
+ void setCachedFormat(const QTextCharFormat &format, quint32 formatType, quint32 messageLabel) const;
+ void mergeFormat(QTextCharFormat &format, quint32 formatType, quint64 messageLabel) const;
+ void mergeSubElementFormat(QTextCharFormat &format, quint32 formatType, quint64 messageLabel) const;
static FormatType formatType(const QString &code);
static QString formatCode(FormatType);
QVariant itemData(int role, const QTextCharFormat &format) const;
private slots:
- void showItemViewIconsChanged();
+ void allowMircColorsChanged(const QVariant &);
+ void showItemViewIconsChanged(const QVariant &);
private:
QVector<QBrush> _uiStylePalette;
QBrush _markerLineBrush;
QHash<quint64, QTextCharFormat> _formats;
- QHash<quint64, QTextCharFormat> _formatCache;
- QHash<quint64, QFontMetricsF *> _metricsCache;
+ mutable QHash<quint64, QTextCharFormat> _formatCache;
+ mutable QHash<quint64, QFontMetricsF *> _metricsCache;
QHash<quint32, QTextCharFormat> _listItemFormats;
static QHash<QString, FormatType> _formatCodes;
static QString _timestampFormatString;
int _voiceIconLimit;
bool _showNickViewIcons;
bool _showBufferViewIcons;
+ bool _allowMircColors;
};
class UiStyle::StyledMessage : public Message {