X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fuisupport%2Fstyledlabel.cpp;h=f54bea81e2f0d7df3cc70895615f2fad19bf4abf;hp=78973fc57a34d085096b1bd5634ab140ed9efd4f;hb=3dd76d9373fb46b7be3f7f963b3d3a38ded63ae5;hpb=3fc0adfd0e7e8289d0af45358eedf2943a1839d7 diff --git a/src/uisupport/styledlabel.cpp b/src/uisupport/styledlabel.cpp index 78973fc5..f54bea81 100644 --- a/src/uisupport/styledlabel.cpp +++ b/src/uisupport/styledlabel.cpp @@ -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();