- enhancement: adjust tab order in the find dialog
- enhancement: highlight hits in the find panel's result list
This commit is contained in:
parent
ff1d3abc16
commit
42af39d28f
2
NEWS.md
2
NEWS.md
|
@ -2,6 +2,8 @@ Red Panda C++ Version 1.0.0
|
|||
- fix: calculation for code snippets's tab stop positions is not correct
|
||||
- fix: Refresh files view shouldn'tchange open/save dialog's default folder
|
||||
- enhancement: "locate in files view" will request user's confirmation when change the working folder
|
||||
- enhancement: adjust tab order in the find dialog
|
||||
- enhancement: highlight hits in the find panel's result list
|
||||
|
||||
Red Panda C++ Version 0.14.5
|
||||
- fix: the "gnu c++ 20" option in compiler set options is wrong
|
||||
|
|
|
@ -460,14 +460,22 @@ void SearchResultTreeViewDelegate::paint(QPainter *painter, const QStyleOptionVi
|
|||
x+=metrics.horizontalAdvance(text);
|
||||
QFont font = option.font;
|
||||
font.setBold(true);
|
||||
font.setItalic(true);
|
||||
QFont oldFont = painter->font();
|
||||
painter->setFont(font);
|
||||
text=item->text.mid(item->start-1,item->len);
|
||||
int width = metrics.horizontalAdvance(text);
|
||||
QFont oldFont = painter->font();
|
||||
QPen oldPen = painter->pen();
|
||||
painter->setPen(qApp->palette().color(QPalette::ColorRole::HighlightedText));
|
||||
painter->setFont(font);
|
||||
QRect rect = textRect;
|
||||
rect.setLeft(x);
|
||||
rect.setWidth(width);
|
||||
painter->fillRect(rect,qApp->palette().color(QPalette::ColorRole::Highlight));
|
||||
painter->drawText(x,y,text);
|
||||
metrics = QFontMetrics(font);
|
||||
x+=metrics.horizontalAdvance(text);
|
||||
x+=width;
|
||||
painter->setFont(oldFont);
|
||||
painter->setPen(oldPen);
|
||||
|
||||
text = item->text.mid(item->start-1+item->len);
|
||||
painter->drawText(x,y,text);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue