diff options
author | Dave Davenport <qball@gmpclient.org> | 2016-10-17 20:54:02 +0200 |
---|---|---|
committer | Dave Davenport <qball@gmpclient.org> | 2016-10-17 20:54:02 +0200 |
commit | df261930961d1235603ba7cc5f917523259c655b (patch) | |
tree | b9f1e186df23100be384f6d4061a3ed8511ac59c /source/widgets | |
parent | 0f1ba8aca816de8d786c81607a821eac616837b0 (diff) |
Fix redrawing (call queue redraw, not need redraw) fix end of string check.
Diffstat (limited to 'source/widgets')
-rw-r--r-- | source/widgets/textbox.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/source/widgets/textbox.c b/source/widgets/textbox.c index 08bb5b60..d03ceb4a 100644 --- a/source/widgets/textbox.c +++ b/source/widgets/textbox.c @@ -161,7 +161,7 @@ void textbox_font ( textbox *tb, TextBoxFontType tbft ) } if ( tb->tbft != tbft ) { tb->update = TRUE; - widget_need_redraw ( WIDGET ( tb ) ); + widget_queue_redraw ( WIDGET ( tb ) ); } tb->tbft = tbft; } @@ -229,7 +229,7 @@ void textbox_text ( textbox *tb, const char *text ) } tb->cursor = MAX ( 0, MIN ( ( int ) g_utf8_strlen ( tb->text, -1 ), tb->cursor ) ); - widget_need_redraw ( WIDGET ( tb ) ); + widget_queue_redraw ( WIDGET ( tb ) ); } // within the parent handled auto width/height modes @@ -268,7 +268,7 @@ void textbox_moveresize ( textbox *tb, int x, int y, int w, int h ) // We always want to update this pango_layout_set_width ( tb->layout, PANGO_SCALE * ( tb->widget.w - 2 * config.line_padding - offset ) ); tb->update = TRUE; - widget_need_redraw ( WIDGET ( tb ) ); + widget_queue_redraw ( WIDGET ( tb ) ); } // will also unmap the window if still displayed @@ -401,9 +401,9 @@ void textbox_cursor ( textbox *tb, int pos ) int length = ( tb->text == NULL ) ? 0 : g_utf8_strlen ( tb->text, -1 ); tb->cursor = MAX ( 0, MIN ( length, pos ) ); tb->update = TRUE; - widget_need_redraw ( WIDGET ( tb ) ); // Stop blink! - tb->blink = 2; + tb->blink = 3; + widget_queue_redraw ( WIDGET ( tb ) ); } // move right @@ -434,7 +434,7 @@ static void textbox_cursor_inc_word ( textbox *tb ) break; } } - if ( c == NULL ) { + if ( *c == '\0' ) { return; } while ( ( c = g_utf8_next_char ( c ) ) ) { @@ -486,12 +486,12 @@ void textbox_cursor_end ( textbox *tb ) if ( tb->text == NULL ) { tb->cursor = 0; tb->update = TRUE; - widget_need_redraw ( WIDGET ( tb ) ); + widget_queue_redraw ( WIDGET ( tb ) ); return; } tb->cursor = ( int ) g_utf8_strlen ( tb->text, -1 ); tb->update = TRUE; - widget_need_redraw ( WIDGET ( tb ) ); + widget_queue_redraw ( WIDGET ( tb ) ); // Stop blink! tb->blink = 2; } |