Commit 35674bd6 authored by Waqar Ahmed's avatar Waqar Ahmed
Browse files

Highlight matches as bold like before

parent 8c750251
......@@ -134,6 +134,7 @@ public:
using FormatRange = QTextLayout::FormatRange;
QTextCharFormat fmt;
fmt.setFontWeight(QFont::Bold);
fmt.setForeground(options.palette.link());
QVector<FormatRange> formats;
QTextCharFormat gray;
......@@ -155,11 +156,14 @@ public:
j = matchPos;
}
QTextLayout textLayout(original, option.font);
QTextLayout textLayout(original, options.font);
auto fmts = textLayout.formats();
formats.append(fmts);
textLayout.setFormats(formats);
textLayout.setTextOption(textOption);
layoutViewItemText(textLayout, options.rect.width());
const auto pos = QPointF(options.rect.x(), options.rect.y());
textLayout.draw(painter, pos, formats);
textLayout.draw(painter, pos);
painter->restore();
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment