X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fqtui%2Fchatitem.cpp;h=7aa75aaac1feec3982aca6b77fa476e121be9798;hp=fc0f90169386cf0a41e9e75be1be813594c97ced;hb=673ded0d543cbdc2cf6e746b6bee7c1d21af8f90;hpb=c1cf157116de7fc3da96203aa6f03c38c7ebb650 diff --git a/src/qtui/chatitem.cpp b/src/qtui/chatitem.cpp index fc0f9016..7aa75aaa 100644 --- a/src/qtui/chatitem.cpp +++ b/src/qtui/chatitem.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 * @@ -142,11 +142,12 @@ void ChatItem::initLayoutHelper(QTextLayout* layout, QTextOption::WrapMode wrapM option.setAlignment(alignment); layout->setTextOption(option); - QList formatRanges = QtUi::style() - ->toTextLayoutList(formatList(), - layout->text().length(), - data(ChatLineModel::MsgLabelRole).value()); - layout->setAdditionalFormats(formatRanges); + UiStyle::FormatContainer formatRanges = QtUi::style()->toTextLayoutList( + formatList(), + layout->text().length(), + data(ChatLineModel::MsgLabelRole).value() + ); + UiStyle::setTextLayoutFormats(*layout, formatRanges); } void ChatItem::initLayout(QTextLayout* layout) const @@ -347,16 +348,16 @@ QVector ChatItem::additionalFormats() const } // Add all formats that have an extra label to the additionalFormats list - QList additionalFormats; + UiStyle::FormatContainer additionalFormats; for (size_t i = 0; i < labelFmtList.size() - 1; ++i) { if (labelFmtList[i].label != itemLabel) { additionalFormats << QtUi::style()->toTextLayoutList({std::make_pair(labelFmtList[i].offset, labelFmtList[i].format)}, - labelFmtList[i + 1].offset, - labelFmtList[i].label); + labelFmtList[i + 1].offset, + labelFmtList[i].label); } } - return additionalFormats.toVector(); + return UiStyle::containerToVector(additionalFormats); } bool ChatItem::hasSelection() const @@ -823,7 +824,7 @@ void ContentsChatItem::addActionsToMenu(QMenu* menu, const QPointF& pos) case Clickable::Url: { privateData()->activeClickable = click; auto action = new Action{icon::get("edit-copy"), tr("Copy Link Address"), menu, &_actionProxy, &ActionProxy::copyLinkToClipboard}; - action->setData(QVariant::fromValue(this)); + action->setData(QVariant::fromValue(static_cast(this))); menu->addAction(action); break; }