From 79d4cbe967a4e27b291695778a928a5cdd59388c Mon Sep 17 00:00:00 2001 From: James Booth Date: Sat, 20 Dec 2014 22:44:01 +0000 Subject: Fixed /occupants hide --- src/ui/window.c | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/ui/window.c b/src/ui/window.c index 6849da9d..513f5842 100644 --- a/src/ui/window.c +++ b/src/ui/window.c @@ -254,14 +254,21 @@ win_show_subwin(ProfWin *window) int cols = getmaxx(stdscr); int subwin_cols = 0; - if (window->layout->type == LAYOUT_SPLIT) { - ProfLayoutSplit *layout = (ProfLayoutSplit*)window->layout; + if (window->layout->type != LAYOUT_SPLIT) { + return; + } + + if (window->type == WIN_MUC) { + subwin_cols = win_occpuants_cols(); + } else if (window->type == WIN_CONSOLE) { subwin_cols = win_roster_cols(); - layout->subwin = newpad(PAD_SIZE, subwin_cols); - wbkgd(layout->subwin, theme_attrs(THEME_TEXT)); - wresize(layout->super.win, PAD_SIZE, cols - subwin_cols); - win_redraw(window); } + + ProfLayoutSplit *layout = (ProfLayoutSplit*)window->layout; + layout->subwin = newpad(PAD_SIZE, subwin_cols); + wbkgd(layout->subwin, theme_attrs(THEME_TEXT)); + wresize(layout->super.win, PAD_SIZE, cols - subwin_cols); + win_redraw(window); } void -- cgit 1.4.1-2-gfad0