MCPcopy Create free account
hub / github.com/KDE/kate / drawLineNumber

Method drawLineNumber

apps/lib/diff/difflinenumarea.cpp:187–203  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

185}
186
187void LineNumArea::drawLineNumber(QPainter &painter, QRect rect, int blockNumber, int num, const LineNumColors &c)
188{
189 if (num < 0) {
190 return;
191 }
192
193 const QString number = QString::number(num);
194 QPen p = c.otherLine;
195 const LineHighlight *hl = textEdit->highlightingForLine(blockNumber);
196 if (hl) {
197 p = hl->added ? c.added : c.removed;
198 }
199
200 painter.setPen(p);
201 rect.adjust(0, 0, -(Margin * 2), 0);
202 painter.drawText(rect, Qt::AlignRight | Qt::AlignVCenter | Qt::TextDontClip, number);
203}
204
205void LineNumArea::mousePressEvent(QMouseEvent *e)
206{

Callers

nothing calls this directly

Calls 1

highlightingForLineMethod · 0.80

Tested by

no test coverage detected