| 477 | } |
| 478 | |
| 479 | void DiffTextWindow::printWindow(RLPainter& painter, const QRect& view, const QString& headerText, qint32 line, const LineType linesPerPage, const QColor& fgColor) |
| 480 | { |
| 481 | QRect clipRect = view; |
| 482 | clipRect.setTop(0); |
| 483 | painter.setClipRect(clipRect); |
| 484 | painter.translate(view.left(), 0); |
| 485 | QFontMetrics fm = painter.fontMetrics(); |
| 486 | { |
| 487 | qint32 lineHeight = fm.height() + fm.ascent(); |
| 488 | const QRectF headerRect(0, 5, view.width(), 3 * (lineHeight)); |
| 489 | QTextOption options; |
| 490 | options.setWrapMode(QTextOption::WordWrap); |
| 491 | // TODO: transition to Qt::LayoutDirectionAuto |
| 492 | options.setTextDirection(Qt::LeftToRight); |
| 493 | static_cast<QPainter&>(painter).drawText(headerRect, headerText, options); |
| 494 | |
| 495 | painter.setPen(fgColor); |
| 496 | painter.drawLine(0, view.top() - 2, view.width(), view.top() - 2); |
| 497 | } |
| 498 | |
| 499 | painter.translate(0, view.top()); |
| 500 | print(painter, view, line, linesPerPage); |
| 501 | painter.resetTransform(); |
| 502 | } |
| 503 | |
| 504 | void DiffTextWindow::setFirstLine(LineRef firstLine) |
| 505 | { |
no test coverage detected