From 9dad7a7ffd21de27c32ffa3f5fa0ca23eea74ac2 Mon Sep 17 00:00:00 2001 From: James Booth Date: Sun, 22 Apr 2012 22:35:54 +0100 Subject: [PATCH] Resize current pad --- windows.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/windows.c b/windows.c index ee7ad59f..a6c68833 100644 --- a/windows.c +++ b/windows.c @@ -57,6 +57,7 @@ static void _cons_show_incoming_message(const char * const short_from, const int win_index); static void _win_handle_switch(const int * const ch); static void _win_handle_page(const int * const ch); +static void _win_resize_all(void); void gui_init(void) { @@ -110,7 +111,7 @@ void gui_resize(const int ch, const char * const input, const int size) { title_bar_resize(); status_bar_resize(); - _current_window_refresh(); + _win_resize_all(); inp_win_resize(input, size); dirty = TRUE; } @@ -474,7 +475,7 @@ static void _win_show_message(WINDOW *win, const char * const message) wattron(win, A_BOLD); } -static void _current_window_refresh() +static void _current_window_refresh(void) { int rows, cols; getmaxyx(stdscr, rows, cols); @@ -483,6 +484,16 @@ static void _current_window_refresh() prefresh(current, _wins[_curr_prof_win].y_pos, 0, 1, 0, rows-3, cols-1); } +void _win_resize_all(void) +{ + int rows, cols; + getmaxyx(stdscr, rows, cols); + + WINDOW *current = _wins[_curr_prof_win].win; + wresize(current, PAD_SIZE, cols); + prefresh(current, _wins[_curr_prof_win].y_pos, 0, 1, 0, rows-3, cols-1); +} + static void _show_status_string(WINDOW *win, const char * const from, const char * const show, const char * const status, const char * const pre, const char * const default_show)