From cecc9edd95fea4728325575406deb866db8227ee Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Tue, 24 Sep 2019 00:00:06 +0300 Subject: [PATCH] Mark Entry for rebuild when cursor starts or stops blinking --- source/entry.cpp | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/source/entry.cpp b/source/entry.cpp index ed0d7e2..11fd242 100644 --- a/source/entry.cpp +++ b/source/entry.cpp @@ -446,18 +446,21 @@ void Entry::erase_selection(bool emit_change) void Entry::check_cursor_blink() { + const Part *cursor_part = style->get_part("cursor"); + bool has_blink = (cursor_part && cursor_part->get_graphic(ACTIVE|FOCUS)!=cursor_part->get_graphic(NORMAL|FOCUS)); + cursor_blink = (state&FOCUS); - if((state&FOCUS) && style) + if((state&FOCUS) && style && has_blink) { - const Part *cursor_part = style->get_part("cursor"); - if(cursor_part && cursor_part->get_graphic(ACTIVE|FOCUS)!=cursor_part->get_graphic(NORMAL|FOCUS)) - { - set_animation_interval(Time::sec/2); - return; - } + set_animation_interval(Time::sec/2); + mark_rebuild(); + } + else + { + if(has_blink) + mark_rebuild(); + stop_animation(); } - - stop_animation(); } void Entry::check_view_range() -- 2.45.2