about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2012-04-20 01:38:04 +0100
committerJames Booth <boothj5@gmail.com>2012-04-20 01:38:04 +0100
commit53130f0e786b64c9c24e3c28f70992c235726a10 (patch)
tree55947d4efc5542ee5f37eaed976368267d60aa81
parentea261b8852a7c1dad462e71ed0442c00a142adc2 (diff)
downloadprofani-tty-53130f0e786b64c9c24e3c28f70992c235726a10.tar.gz
Added title bar redraw
-rw-r--r--title_bar.c12
-rw-r--r--windows.c2
-rw-r--r--windows.h1
3 files changed, 14 insertions, 1 deletions
diff --git a/title_bar.c b/title_bar.c
index 96d8bc5d..09182da3 100644
--- a/title_bar.c
+++ b/title_bar.c
@@ -63,6 +63,18 @@ void title_bar_disconnected(void)
     _title_bar_draw_status();
 }
 
+void title_bar_redraw(void)
+{
+    int rows, cols;
+    getmaxyx(stdscr, rows, cols);
+
+    title_bar = newwin(1, cols, 0, 0);
+    wbkgd(title_bar, COLOR_PAIR(3));
+    _title_bar_draw_title();
+    _title_bar_draw_status();
+    dirty = TRUE;
+}
+
 void title_bar_refresh(void)
 {
     if (dirty) {
diff --git a/windows.c b/windows.c
index ec30310f..d0af3ffa 100644
--- a/windows.c
+++ b/windows.c
@@ -108,7 +108,7 @@ void gui_close(void)
 
 void gui_resize(const int ch, const char * const input, const int size)
 {
-    create_title_bar();
+    title_bar_redraw();
     create_status_bar();
     create_input_window();
     inp_win_write(input, size);
diff --git a/windows.h b/windows.h
index ed9eabfc..7436a8a8 100644
--- a/windows.h
+++ b/windows.h
@@ -47,6 +47,7 @@ void create_input_window(void);
 
 // title bar actions
 void title_bar_refresh(void);
+void title_bar_redraw(void);
 void title_bar_show(const char * const title);
 void title_bar_title(void);
 void title_bar_connected(void);