X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=src%2Fqtui%2Fqtuistyle.cpp;h=7516c22477d08be6f15eab42602bd5ce6d5454bf;hb=92fc8c5b119111a35ab8423c3cbde5b2a022badf;hp=3a5b6490fa32eb76c4912940ef004f43a2d2a4bf;hpb=68878dc8366f2f4a0afe132847aad9a51a80cdbf;p=quassel.git diff --git a/src/qtui/qtuistyle.cpp b/src/qtui/qtuistyle.cpp index 3a5b6490..7516c224 100644 --- a/src/qtui/qtuistyle.cpp +++ b/src/qtui/qtuistyle.cpp @@ -32,8 +32,8 @@ QtUiStyle::QtUiStyle(QObject *parent) : UiStyle(parent) updateUseCustomTimestampFormat(); s.notify("TimestampFormat", this, SLOT(updateTimestampFormatString())); updateTimestampFormatString(); - s.notify("ShowSenderPrefixes", this, SLOT(updateShowSenderPrefixes())); - updateShowSenderPrefixes(); + s.notify("SenderPrefixMode", this, SLOT(updateSenderPrefixDisplay())); + updateSenderPrefixDisplay(); s.notify("ShowSenderBrackets", this, SLOT(updateShowSenderBrackets())); updateShowSenderBrackets(); @@ -56,10 +56,10 @@ void QtUiStyle::updateTimestampFormatString() setTimestampFormatString(s.timestampFormatString()); } -void QtUiStyle::updateShowSenderPrefixes() +void QtUiStyle::updateSenderPrefixDisplay() { ChatViewSettings s; - enableSenderPrefixes(s.showSenderPrefixes()); + setSenderPrefixDisplay(s.SenderPrefixDisplay()); } void QtUiStyle::updateShowSenderBrackets() @@ -215,15 +215,16 @@ QString QtUiStyle::color(const QString &key, UiSettings &settings, const QColor QString QtUiStyle::fontDescription(const QFont &font) const { - QString desc = "font: "; - if (font.italic()) - desc += "italic "; - if (font.bold()) - desc += "bold "; - if (!font.italic() && !font.bold()) - desc += "normal "; - desc += QString("%1pt \"%2\"").arg(font.pointSize()).arg(font.family()); - return desc; + QFont::Style style = font.style(); + int weight = font.weight(); + + return QString("font: %1 %2 %3pt \"%4\"") + .arg(style == QFont::StyleItalic ? "italic" : + style == QFont::StyleOblique ? "oblique" : + "normal") + .arg(100 * qBound(1, (weight * 8 + 50) / 100, 9)) + .arg(font.pointSize()) + .arg(font.family()); }