| 185 | } |
| 186 | |
| 187 | void 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 | |
| 205 | void LineNumArea::mousePressEvent(QMouseEvent *e) |
| 206 | { |
nothing calls this directly
no test coverage detected