X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fuisupport%2Fstyledlabel.cpp;h=2bce05fee802f1c6f0bd206e77e7b3a5a5579f2a;hp=f00764034ee53eb0bc4c0b2c24c2d8e3407b2137;hb=a95ad2de573027f9bee36db972bcae4195168d0c;hpb=c1cf157116de7fc3da96203aa6f03c38c7ebb650 diff --git a/src/uisupport/styledlabel.cpp b/src/uisupport/styledlabel.cpp index f0076403..2bce05fe 100644 --- a/src/uisupport/styledlabel.cpp +++ b/src/uisupport/styledlabel.cpp @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2005-2018 by the Quassel Project * + * Copyright (C) 2005-2020 by the Quassel Project * * devel@quassel-irc.org * * * * This program is free software; you can redistribute it and/or modify * @@ -110,10 +110,8 @@ void StyledLabel::updateSizeHint() void StyledLabel::setText(const QString& text) { - UiStyle* style = GraphicalUi::uiStyle(); - - UiStyle::StyledString sstr = style->styleString(style->mircToInternal(text), UiStyle::FormatType::PlainMsg); - QList layoutList = style->toTextLayoutList(sstr.formatList, sstr.plainText.length(), UiStyle::MessageLabel::None); + UiStyle::StyledString sstr = UiStyle::styleString(UiStyle::mircToInternal(text), UiStyle::FormatType::PlainMsg); + UiStyle::FormatContainer layoutList = GraphicalUi::uiStyle()->toTextLayoutList(sstr.formatList, sstr.plainText.length(), UiStyle::MessageLabel::None); // Use default font rather than the style's QTextLayout::FormatRange fmtRange; @@ -135,7 +133,7 @@ void StyledLabel::setText(const QString& text) } _layout.setText(sstr.plainText); - _layout.setAdditionalFormats(layoutList); + UiStyle::setTextLayoutFormats(_layout, layoutList); layout();