From f0e5e585f88724b812f682b81d8a2d3bdca4ceb5 Mon Sep 17 00:00:00 2001 From: James Booth Date: Thu, 16 Jan 2014 20:09:54 +0000 Subject: Removed title_bar_draw from UI module --- src/ui/core.c | 9 --------- src/ui/titlebar.c | 17 ++++++++--------- src/ui/ui.h | 1 - 3 files changed, 8 insertions(+), 19 deletions(-) diff --git a/src/ui/core.c b/src/ui/core.c index f14c6803..09cae2ac 100644 --- a/src/ui/core.c +++ b/src/ui/core.c @@ -191,7 +191,6 @@ _ui_contact_typing(const char * const barejid) // in chat window with user } else { title_bar_set_typing(TRUE); - title_bar_draw(); int num = wins_get_num(window); status_bar_active(num); @@ -260,7 +259,6 @@ _ui_incoming_msg(const char * const from, const char * const message, if (wins_is_current(window)) { win_print_incoming_message(window, tv_stamp, display_from, message); title_bar_set_typing(FALSE); - title_bar_draw(); status_bar_active(num); wins_refresh_current(); @@ -558,7 +556,6 @@ _ui_switch_win(const int i) GString *recipient_str = _get_recipient_string(new_current); title_bar_set_recipient(recipient_str->str); g_string_free(recipient_str, TRUE); - title_bar_draw(); status_bar_current(i); status_bar_active(i); } @@ -585,7 +582,6 @@ _ui_next_win(void) GString *recipient_str = _get_recipient_string(new_current); title_bar_set_recipient(recipient_str->str); g_string_free(recipient_str, TRUE); - title_bar_draw(); status_bar_current(i); status_bar_active(i); } @@ -605,7 +601,6 @@ _ui_gone_secure(const char * const recipient, gboolean trusted) GString *recipient_str = _get_recipient_string(window); title_bar_set_recipient(recipient_str->str); g_string_free(recipient_str, TRUE); - title_bar_draw(); wins_refresh_current(); } } @@ -624,7 +619,6 @@ _ui_gone_insecure(const char * const recipient) GString *recipient_str = _get_recipient_string(window); title_bar_set_recipient(recipient_str->str); g_string_free(recipient_str, TRUE); - title_bar_draw(); wins_refresh_current(); } } @@ -642,7 +636,6 @@ _ui_trust(const char * const recipient) GString *recipient_str = _get_recipient_string(window); title_bar_set_recipient(recipient_str->str); g_string_free(recipient_str, TRUE); - title_bar_draw(); wins_refresh_current(); } } @@ -660,7 +653,6 @@ _ui_untrust(const char * const recipient) GString *recipient_str = _get_recipient_string(window); title_bar_set_recipient(recipient_str->str); g_string_free(recipient_str, TRUE); - title_bar_draw(); wins_refresh_current(); } } @@ -685,7 +677,6 @@ _ui_previous_win(void) GString *recipient_str = _get_recipient_string(new_current); title_bar_set_recipient(recipient_str->str); g_string_free(recipient_str, TRUE); - title_bar_draw(); status_bar_current(i); status_bar_active(i); } diff --git a/src/ui/titlebar.c b/src/ui/titlebar.c index a8470f80..f22eb43f 100644 --- a/src/ui/titlebar.c +++ b/src/ui/titlebar.c @@ -36,6 +36,8 @@ static contact_presence_t current_presence; static GTimer *typing_elapsed; +static void _title_bar_draw(void); + static void _create_title_bar(void) { @@ -59,7 +61,7 @@ _title_bar_console(void) free(current_title); current_title = strdup(CONSOLE_TITLE); - title_bar_draw(); + _title_bar_draw(); } static void @@ -70,7 +72,7 @@ _title_bar_resize(void) wresize(win, 1, cols); wbkgd(win, COLOUR_TITLE_TEXT); - title_bar_draw(); + _title_bar_draw(); } static void @@ -89,7 +91,7 @@ _title_bar_refresh(void) g_timer_destroy(typing_elapsed); typing_elapsed = NULL; - title_bar_draw(); + _title_bar_draw(); } } } @@ -99,7 +101,7 @@ static void _title_bar_set_presence(contact_presence_t presence) { current_presence = presence; - title_bar_draw(); + _title_bar_draw(); } static void @@ -116,8 +118,7 @@ _title_bar_set_recipient(const char * const recipient) free(current_title); current_title = strdup(recipient); - wrefresh(win); - inp_put_back(); + _title_bar_draw(); } static void @@ -139,8 +140,7 @@ _title_bar_set_typing(gboolean is_typing) current_title = strdup(new_title->str); g_string_free(new_title, TRUE); - wrefresh(win); - inp_put_back(); + _title_bar_draw(); } static void @@ -202,5 +202,4 @@ titlebar_init_module(void) title_bar_set_presence = _title_bar_set_presence; title_bar_set_recipient = _title_bar_set_recipient; title_bar_set_typing = _title_bar_set_typing; - title_bar_draw = _title_bar_draw; } diff --git a/src/ui/ui.h b/src/ui/ui.h index 1ab0f3e7..63af3da6 100644 --- a/src/ui/ui.h +++ b/src/ui/ui.h @@ -158,7 +158,6 @@ void (*title_bar_console)(void); void (*title_bar_set_presence)(contact_presence_t presence); void (*title_bar_set_recipient)(const char * const from); void (*title_bar_set_typing)(gboolean is_typing); -void (*title_bar_draw)(void); // console window actions void (*cons_show)(const char * const msg, ...); -- cgit 1.4.1-2-gfad0