Don't try to mark all incoming messages with the Backlog flag
[quassel.git] / src / uisupport / qssparser.cpp
index 52ce79a..8234404 100644 (file)
@@ -127,7 +127,7 @@ void QssParser::parseChatLineData(const QString &decl, const QString &contents)
     }
   }
 
-  _formats[fmtType] = format;
+  _formats[fmtType].merge(format);
 }
 
 quint64 QssParser::parseFormatType(const QString &decl) {
@@ -212,6 +212,8 @@ quint64 QssParser::parseFormatType(const QString &decl) {
         quint64 labeltype = 0;
         if(condValue == "highlight")
           labeltype = UiStyle::Highlight;
+        else if(condValue == "selected")
+          labeltype = UiStyle::Selected;
         else {
           qWarning() << Q_FUNC_INFO << tr("Invalid message label: %1").arg(condValue);
           return UiStyle::Invalid;
@@ -300,6 +302,13 @@ void QssParser::parsePaletteData(const QString &decl, const QString &contents) {
     }
     QString rolestr = line.left(idx).trimmed();
     QString brushstr = line.mid(idx + 1).trimmed();
+
+    // We treat the marker line color as a palette role even though it isn't -> special casing
+    if(rolestr == "marker-line") {
+      _markerLineBrush = parseBrush(brushstr);
+      continue;
+    }
+
     if(!_paletteColorRoles.contains(rolestr)) {
       qWarning() << Q_FUNC_INFO << tr("Unknown palette role name: %1").arg(rolestr);
       continue;
@@ -486,7 +495,7 @@ QGradientStops QssParser::parseGradientStops(const QString &str_) {
 /******** Font Properties ********/
 
 void QssParser::parseFont(const QString& value, QTextCharFormat* format) {
-  QRegExp rx("((?:(?:normal|italic|oblique|bold|100|200|300|400|500|600|700|800|900) ){0,2}) ?(\\d+)(pt|px)? \"(.*)\"");
+  QRegExp rx("((?:(?:normal|italic|oblique|underline|bold|100|200|300|400|500|600|700|800|900) ){0,2}) ?(\\d+)(pt|px)? \"(.*)\"");
   if(!rx.exactMatch(value)) {
     qWarning() << Q_FUNC_INFO << tr("Invalid font specification: %1").arg(value);
     return;
@@ -497,6 +506,8 @@ void QssParser::parseFont(const QString& value, QTextCharFormat* format) {
   foreach(QString prop, proplist) {
     if(prop == "italic")
       format->setFontItalic(true);
+    else if(prop == "underline")
+      format->setFontUnderline(true);
     //else if(prop == "oblique")
     //  format->setStyle(QFont::StyleOblique);
     else if(prop == "bold")
@@ -520,6 +531,8 @@ void QssParser::parseFontStyle(const QString& value, QTextCharFormat* format) {
     format->setFontItalic(false);
   else if(value == "italic")
     format->setFontItalic(true);
+  else if(value == "underline")
+    format->setFontUnderline(true);
   //else if(value == "oblique")
   //  format->setStyle(QFont::StyleOblique);
   else {