From 5033d6898f31fc4a081a177945ed62c932e4822b Mon Sep 17 00:00:00 2001 From: Adrien Destugues Date: Sun, 19 Jul 2020 15:02:43 +0200 Subject: [PATCH] SerialConnect: make reverse video work It's useful to see our openboot boot menu. I'm not sure what B_NEGATIVE_FACE is meant to do. The be book says "Characters are drawn in the low color, while the background is drawn in the high color.", but DrawString does not draw the background, so some color swapping will still be needed in this case anyway. --- src/apps/serialconnect/TermView.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/apps/serialconnect/TermView.cpp b/src/apps/serialconnect/TermView.cpp index 50704ab73a..01e1b2adae 100644 --- a/src/apps/serialconnect/TermView.cpp +++ b/src/apps/serialconnect/TermView.cpp @@ -111,7 +111,7 @@ TermView::Draw(BRect updateRect) background.alpha = 255; // Draw the cursor by swapping foreground and background colors - if (isCursor) { + if (isCursor ^ cell.attrs.reverse) { SetLowColor(foreground); SetViewColor(foreground); SetHighColor(background); @@ -135,8 +135,12 @@ TermView::Draw(BRect updateRect) font.SetFace(B_ITALIC_FACE); if (cell.attrs.blink) // FIXME make it actually blink font.SetFace(B_OUTLINED_FACE); +#if 0 + // FIXME B_NEGATIVE_FACE isn't actually implemented so we + // instead swap the colors above if (cell.attrs.reverse) font.SetFace(B_NEGATIVE_FACE); +#endif if (cell.attrs.strike) font.SetFace(B_STRIKEOUT_FACE);