merge conflicts, text copying from context menu in message line

This commit is contained in:
Blue 2022-04-30 21:41:25 +03:00
commit c3a45ec58c
Signed by untrusted user: blue
GPG key ID: 9B203B252A63EE38
38 changed files with 1221 additions and 798 deletions

View file

@ -664,9 +664,32 @@ int MessageDelegate::paintBody(const Models::FeedItem& data, QPainter* painter,
if (data.text.size() > 0) {
bodyRenderer->setHtml(Shared::processMessageBody(data.text));
bodyRenderer->setTextWidth(option.rect.size().width());
painter->setBackgroundMode(Qt::BGMode::OpaqueMode);
painter->save();
// QTextCursor cursor(bodyRenderer);
// cursor.setPosition(2, QTextCursor::KeepAnchor);
painter->translate(option.rect.topLeft());
// QTextFrameFormat format = bodyRenderer->rootFrame()->frameFormat();
// format.setBackground(option.palette.brush(QPalette::Active, QPalette::Highlight));
// bodyRenderer->rootFrame()->setFrameFormat(format);
bodyRenderer->drawContents(painter);
// QColor c = option.palette.color(QPalette::Active, QPalette::Highlight);
// QTextBlock b = bodyRenderer->begin();
// QTextBlockFormat format = b.blockFormat();
// format.setBackground(option.palette.brush(QPalette::Active, QPalette::Highlight));
// format.setProperty(QTextFormat::BackgroundBrush, option.palette.brush(QPalette::Active, QPalette::Highlight));
// QTextCursor cursor(bodyRenderer);
// cursor.setBlockFormat(format);
// b = bodyRenderer->begin();
// while (b.isValid() > 0) {
// QTextLayout* lay = b.layout();
// QTextLayout::FormatRange range;
// range.format = b.charFormat();
// range.start = 0;
// range.length = 2;
// lay->draw(painter, option.rect.topLeft(), {range});
// b = b.next();
// }
painter->restore();
QSize bodySize(std::ceil(bodyRenderer->idealWidth()), std::ceil(bodyRenderer->size().height()));