From 60e00322da9d077e81352a9e74413a3d879bafe6 Mon Sep 17 00:00:00 2001 From: James Johnson Date: Sat, 23 Sep 2017 12:42:42 -0400 Subject: [PATCH] Added ability to EditWidgetBase to turn off caret blinking. --- src/dlangui/widgets/editors.d | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/dlangui/widgets/editors.d b/src/dlangui/widgets/editors.d index 62fabe25..eaf49ab2 100644 --- a/src/dlangui/widgets/editors.d +++ b/src/dlangui/widgets/editors.d @@ -958,6 +958,11 @@ class EditWidgetBase : ScrollWidgetBase, EditableContentListener, MenuItemAction protected ulong _caretTimerId; protected bool _caretBlinkingPhase; protected long _lastBlinkStartTs; + protected bool _caretBlinks = true; + + void showCaretBlinking(bool blinks) { + _caretBlinks = blinks; + } protected void startCaretBlinking() { if (window) { @@ -1076,7 +1081,7 @@ class EditWidgetBase : ScrollWidgetBase, EditableContentListener, MenuItemAction /// draws caret protected void drawCaret(DrawBuf buf) { if (focused) { - if (_caretBlinkingPhase) { + if (_caretBlinkingPhase && _caretBlinks) { return; } // draw caret