Commit 1bc9be4d authored by Martin Tobias Holmedahl Sandsmark's avatar Martin Tobias Holmedahl Sandsmark Committed by Tomaz Canabrava
Browse files

bring back some lost comments

parent 1f841ec4
......@@ -538,6 +538,9 @@ void TerminalPainter::drawCursor(QPainter &painter, const QRect &rect, const QCo
return;
}
// shift rectangle top down one pixel to leave some space
// between top and bottom
// noticeable when linespace>1
QRectF cursorRect = rect.adjusted(0, 1, 0, 0);
QColor color = display->terminalColor()->cursorColor();
......@@ -553,13 +556,16 @@ void TerminalPainter::drawCursor(QPainter &painter, const QRect &rect, const QCo
painter.setPen(pen);
if (display->cursorShape() == Enum::BlockCursor) {
if (display->hasFocus()) {
painter.fillRect(cursorRect, cursorColor);
// invert the color used to draw the text to ensure that the character at
// the cursor position is readable
QColor cursorTextColor = display->terminalColor()->cursorTextColor();
characterColor = cursorTextColor.isValid() ? cursorTextColor : backgroundColor;
} else {
// draw the cursor outline, adjusting the area so that
// it is draw entirely inside cursorRect
painter.drawRect(cursorRect.adjusted(halfWidth, halfWidth, -halfWidth, -halfWidth));
}
} else if (display->cursorShape() == Enum::UnderlineCursor) {
......
Supports Markdown
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