Terminal: show a different cursor when window isn't active or view is unfocused

"empty" cursor when unfocused, "filled" when focused, similar to what other terminals do in other platforms

Change-Id: I7ccafaacab8cfb63d8e556ca3ee76335ebb0cf0e
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9165
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: nephele nephele <[email protected]>
This commit is contained in:
JackBurton79
2025-04-22 12:50:55 +00:00
committed by Adrien Destugues
parent 87f30d6791
commit 65ed72e669
+6 -3
View File
@@ -873,10 +873,10 @@ TermView::SwitchCursorBlinking(bool blinkingOn)
} else {
// make sure the cursor becomes visible
fCursorState = 0;
_InvalidateTextRect(fCursor.x, fCursor.y, fCursor.x, fCursor.y);
delete fCursorBlinkRunner;
fCursorBlinkRunner = NULL;
}
_InvalidateTextRect(fCursor.x, fCursor.y, fCursor.x, fCursor.y);
}
@@ -1235,8 +1235,11 @@ TermView::_DrawCursor()
if (attr.IsWidth() && fCursorStyle != IBEAM_CURSOR)
rect.right += fFontWidth;
FillRect(rect);
if (Window()->IsActive() && IsFocus()) {
FillRect(rect);
} else {
StrokeRect(rect);
}
}
}