From a05018fce868dd4627e720816f36fb8284257e95 Mon Sep 17 00:00:00 2001 From: Manuel Nickschas Date: Tue, 4 Aug 2009 00:53:58 +0200 Subject: [PATCH] Various fixes for the style engine This should iron out the last remaining buggy corner cases. I hope. --- src/qtui/qtuistyle.cpp | 4 ++-- src/uisupport/qssparser.cpp | 2 +- src/uisupport/uistyle.cpp | 3 ++- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/qtui/qtuistyle.cpp b/src/qtui/qtuistyle.cpp index 4086eeda..f37b85e1 100644 --- a/src/qtui/qtuistyle.cpp +++ b/src/qtui/qtuistyle.cpp @@ -93,7 +93,7 @@ void QtUiStyle::generateSettingsQss() const { if(s.value("UseSenderColors").toBool()) { out << "// Sender Colors\n\n" - << "ChatLine::sender[sender=\"self\"] { foreground: " << color("SenderSelf", s) << "; }\n\n"; + << "ChatLine::sender#plain[sender=\"self\"] { foreground: " << color("SenderSelf", s) << "; }\n\n"; for(int i = 0; i < 16; i++) out << senderQss(i, s); @@ -114,5 +114,5 @@ QString QtUiStyle::senderQss(int i, QtUiStyleSettings &settings) const { QString dez = QString::number(i); if(dez.length() == 1) dez.prepend('0'); - return QString("ChatLine::sender[sender=\"0%1\"] { foreground: %2; }\n").arg(QString::number(i, 16), color("Sender"+dez, settings)); + return QString("ChatLine::sender#plain[sender=\"0%1\"] { foreground: %2; }\n").arg(QString::number(i, 16), color("Sender"+dez, settings)); } diff --git a/src/uisupport/qssparser.cpp b/src/uisupport/qssparser.cpp index 7200e582..d5b9984f 100644 --- a/src/uisupport/qssparser.cpp +++ b/src/uisupport/qssparser.cpp @@ -262,7 +262,7 @@ quint64 QssParser::parseFormatType(const QString &decl) { qWarning() << Q_FUNC_INFO << tr("Senderhash can be at most \"0x0f\"!"); return UiStyle::Invalid; } - fmtType |= val << 48; + fmtType |= ++val << 48; } } else if(condName == "format") { if(condValue == "bold") diff --git a/src/uisupport/uistyle.cpp b/src/uisupport/uistyle.cpp index 1626c01b..025c9d1d 100644 --- a/src/uisupport/uistyle.cpp +++ b/src/uisupport/uistyle.cpp @@ -87,6 +87,7 @@ void UiStyle::loadStyleSheet() { qDeleteAll(_metricsCache); _metricsCache.clear(); _formatCache.clear(); + _formats.clear(); UiStyleSettings s; @@ -335,7 +336,7 @@ void UiStyle::mergeFormat(QTextCharFormat &fmt, quint32 ftype, quint64 label) { if((ftype & 0xfff00)) { // element format for(quint32 mask = 0x00100; mask <= 0x40000; mask <<= 1) { if(ftype & mask) { - mergeSubElementFormat(fmt, mask | 0xff, label); + mergeSubElementFormat(fmt, ftype & (mask | 0xff), label); } } } -- 2.20.1