From: Mikko Rasa Date: Mon, 23 Sep 2019 21:00:06 +0000 (+0300) Subject: Mark Entry for rebuild when cursor starts or stops blinking X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=cecc9edd95fea4728325575406deb866db8227ee;p=libs%2Fgltk.git Mark Entry for rebuild when cursor starts or stops blinking --- 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()