X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fuisupport%2Fstyledlabel.cpp;h=53fd6f76abbb94653feaa4cff9fbe3726f9b9ec1;hp=78973fc57a34d085096b1bd5634ab140ed9efd4f;hb=HEAD;hpb=cc6e7c08709c4e761e2fd9c2e322751015497003 diff --git a/src/uisupport/styledlabel.cpp b/src/uisupport/styledlabel.cpp index 78973fc5..53fd6f76 100644 --- a/src/uisupport/styledlabel.cpp +++ b/src/uisupport/styledlabel.cpp @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2005-2019 by the Quassel Project * + * Copyright (C) 2005-2022 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();