Parse format parameters in QSS
authorManuel Nickschas <sputnick@quassel-irc.org>
Wed, 24 Jun 2009 07:44:21 +0000 (09:44 +0200)
committerManuel Nickschas <sputnick@quassel-irc.org>
Thu, 6 Aug 2009 18:25:05 +0000 (20:25 +0200)
Adds [format="$fmt"], where $fmt can be one of "bold", "italic",
"underline" and "reverse" corresponding to the respective mIRC format codes.

src/uisupport/qssparser.cpp

index c25bceb..585b769 100644 (file)
@@ -243,6 +243,20 @@ quint64 QssParser::parseFormatType(const QString &decl) {
             }
             fmtType |= val << 48;
           }
+      } else if(condName == "format") {
+        if(condValue == "bold")
+          fmtType |= UiStyle::Bold;
+        if(condValue == "italic")
+          fmtType |= UiStyle::Italic;
+        if(condValue == "underline")
+          fmtType |= UiStyle::Underline;
+        if(condValue == "reverse")
+          fmtType |= UiStyle::Reverse;
+        else {
+          qWarning() << Q_FUNC_INFO << tr("Invalid format name: %1").arg(condValue);
+          return UiStyle::Invalid;
+        }
+
       }
       // TODO: colors
     }