From 355f2a68fd7431a9ec5667c1aa6a04d566a21a1c Mon Sep 17 00:00:00 2001 From: James Booth Date: Sun, 19 Feb 2012 00:23:45 +0000 Subject: [PATCH] Tidy up titlebar title --- title_bar.c | 8 ++++++-- windows.c | 4 ++-- windows.h | 1 + 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/title_bar.c b/title_bar.c index e26e2cd8..aaa053f1 100644 --- a/title_bar.c +++ b/title_bar.c @@ -5,13 +5,17 @@ static WINDOW *title_bar; void create_title_bar(void) { - char *title = "Profanity. Type /help for help information."; - int rows, cols; getmaxyx(stdscr, rows, cols); title_bar = newwin(1, cols, 0, 0); wbkgd(title_bar, COLOR_PAIR(3)); + title_bar_title(); +} + +void title_bar_title() +{ + char *title = "Profanity. Type /help for help information."; title_bar_show(title); } diff --git a/windows.c b/windows.c index 46544f80..61ffd1db 100644 --- a/windows.c +++ b/windows.c @@ -60,7 +60,7 @@ void win_switch_to(int i) _curr_win = i; if (i == 0) { - title_bar_show("Profanity. Type /help for help information."); + title_bar_title(); } else { title_bar_show(_wins[i].from); } @@ -77,7 +77,7 @@ void win_close_win(void) // go back to console window _curr_win = 0; - title_bar_show("Profanity. Type /help for help information."); + title_bar_title(); } int win_in_chat(void) diff --git a/windows.h b/windows.h index ee40c94e..46e26ec8 100644 --- a/windows.h +++ b/windows.h @@ -21,6 +21,7 @@ void create_input_window(void); // title bar actions void title_bar_refresh(void); void title_bar_show(char *title); +void title_bar_title(void); void title_bar_connected(void); void title_bar_disconnected(void);