Added ability to EditWidgetBase to turn off caret blinking.

This commit is contained in:
James Johnson 2017-09-23 12:42:42 -04:00
parent 1c3a759cf7
commit 60e00322da
1 changed files with 6 additions and 1 deletions

View File

@ -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