}
// Now initialize the mapping between FormatCodes and FormatTypes...
- _formatCodes["%O"] = None;
+ _formatCodes["%O"] = Base;
_formatCodes["%B"] = Bold;
_formatCodes["%S"] = Italic;
_formatCodes["%U"] = Underline;
QssParser parser;
parser.processStyleSheet(styleSheet);
QApplication::setPalette(parser.palette());
- _formatCache = parser.formats();
+
+ QTextCharFormat baseFmt = parser.formats().value(Base);
+ foreach(quint64 fmtType, parser.formats().keys()) {
+ QTextCharFormat fmt = baseFmt;
+ fmt.merge(parser.formats().value(fmtType));
+ _formatCache[fmtType] = fmt;
+ }
qApp->setStyleSheet(styleSheet); // pass the remaining sections to the application
}
* Also, we _do_ rely on certain properties of these values in styleString() and friends!
*/
enum FormatType {
- None = 0x00000000,
+ Base = 0x00000000,
Invalid = 0xffffffff,
// Message Formats (mutually exclusive!)
class StyledMessage;
static FormatType formatType(Message::Type msgType);
- static StyledString styleString(const QString &string, quint32 baseFormat = None);
+ static StyledString styleString(const QString &string, quint32 baseFormat = Base);
static QString mircToInternal(const QString &);
static inline QString timestampFormatString() { return _timestampFormatString; }