diff options
author | James Booth <boothj5@gmail.com> | 2012-04-22 22:35:54 +0100 |
---|---|---|
committer | James Booth <boothj5@gmail.com> | 2012-04-22 22:35:54 +0100 |
commit | 9dad7a7ffd21de27c32ffa3f5fa0ca23eea74ac2 (patch) | |
tree | c347ab83a0a9d015dc4a9f4d6f97f03eee0d1ea5 | |
parent | 6f69ce267b89fe998adfcf722f985378ec75cf8b (diff) | |
download | profani-tty-9dad7a7ffd21de27c32ffa3f5fa0ca23eea74ac2.tar.gz |
Resize current pad
-rw-r--r-- | windows.c | 15 |
1 files 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) |