X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fuisupport%2Fqssparser.cpp;h=b356e2a03a60a0135dccbc3e7d81e90c21031a5d;hp=3e5cd8edd19ed69308f5b64bb05e2b34e0cb6437;hb=a65f42197839da536975b3e2858eedcef420035f;hpb=f56f4515fa722a9e20bca9457ff876e1a0a5f38c diff --git a/src/uisupport/qssparser.cpp b/src/uisupport/qssparser.cpp index 3e5cd8ed..b356e2a0 100644 --- a/src/uisupport/qssparser.cpp +++ b/src/uisupport/qssparser.cpp @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2005-2016 by the Quassel Project * + * Copyright (C) 2005-2019 by the Quassel Project * * devel@quassel-irc.org * * * * This program is free software; you can redistribute it and/or modify * @@ -293,6 +293,8 @@ std::pair QssParser::parseFormatType label |= MessageLabel::Highlight; else if (condValue == "selected") label |= MessageLabel::Selected; + else if (condValue == "hovered") + label |= MessageLabel::Hovered; else { qWarning() << Q_FUNC_INFO << tr("Invalid message label: %1").arg(condValue); return invalid; @@ -721,16 +723,22 @@ void QssParser::parseFont(const QString &value, QTextCharFormat *format) return; } format->setFontItalic(false); + format->setFontUnderline(false); + format->setFontStrikeOut(false); format->setFontWeight(QFont::Normal); QStringList proplist = rx.cap(1).split(' ', QString::SkipEmptyParts); foreach(QString prop, proplist) { - if (prop == "italic") + if (prop == "normal") + ; // pass + else if (prop == "italic") format->setFontItalic(true); else if (prop == "underline") format->setFontUnderline(true); - // Oblique is not a property supported by QTextCharFormat - //else if(prop == "oblique") - // format->setStyle(QFont::StyleOblique); + else if (prop == "strikethrough") + format->setFontStrikeOut(true); + else if(prop == "oblique") + // Oblique is not a property supported by QTextCharFormat + format->setFontItalic(true); else if (prop == "bold") format->setFontWeight(QFont::Bold); else { // number @@ -758,9 +766,9 @@ void QssParser::parseFontStyle(const QString &value, QTextCharFormat *format) format->setFontUnderline(true); else if (value == "strikethrough") format->setFontStrikeOut(true); - // Oblique is not a property supported by QTextCharFormat - //else if(value == "oblique") - // format->setStyle(QFont::StyleOblique); + else if(value == "oblique") + // Oblique is not a property supported by QTextCharFormat + format->setFontItalic(true); else { qWarning() << Q_FUNC_INFO << tr("Invalid font style specification: %1").arg(value); }