From: Kevin Lamonte Date: Fri, 16 Aug 2019 00:18:33 +0000 (-0500) Subject: vertical bar cursor option X-Git-Url: https://git.nikiroo.be/?a=commitdiff_plain;h=5dccc93977b5f3cbde6e791404e5e43ae540ff54;p=nikiroo-utils.git vertical bar cursor option --- diff --git a/src/jexer/backend/SwingTerminal.java b/src/jexer/backend/SwingTerminal.java index ce26efe..283d1ae 100644 --- a/src/jexer/backend/SwingTerminal.java +++ b/src/jexer/backend/SwingTerminal.java @@ -117,7 +117,12 @@ public class SwingTerminal extends LogicalScreen /** * Use an outlined block for the cursor. */ - OUTLINE + OUTLINE, + + /** + * Use a vertical bar for the cursor. + */ + VERTICAL_BAR, } // ------------------------------------------------------------------------ @@ -648,6 +653,8 @@ public class SwingTerminal extends LogicalScreen cursorStyle = CursorStyle.OUTLINE; } else if (cursorStyleString.equals("block")) { cursorStyle = CursorStyle.BLOCK; + } else if (cursorStyleString.equals("verticalbar")) { + cursorStyle = CursorStyle.VERTICAL_BAR; } // Pull the system property for triple buffering. @@ -1302,6 +1309,9 @@ public class SwingTerminal extends LogicalScreen case OUTLINE: gr.drawRect(xPixel, yPixel, cursorWidth - 1, textHeight - 1); break; + case VERTICAL_BAR: + gr.fillRect(xPixel, yPixel, 2, textHeight); + break; } } }