From 55ada8ad2f61f0700b06511048fefff3853e4036 Mon Sep 17 00:00:00 2001 From: Jfreegman Date: Wed, 8 Oct 2014 14:53:09 -0400 Subject: [PATCH] fix groupchat resizing when peerlist is off --- src/settings.c | 40 ++++++++++++++++++++-------------------- src/windows.c | 12 ++++++++---- 2 files changed, 28 insertions(+), 24 deletions(-) diff --git a/src/settings.c b/src/settings.c index 7bfb179..fc6236d 100644 --- a/src/settings.c +++ b/src/settings.c @@ -82,28 +82,28 @@ static void ui_defaults(struct user_settings* settings) } static const struct keys_strings { - const char* self; - const char* next_tab; - const char* prev_tab; - const char* scroll_line_up; - const char* scroll_line_down; - const char* half_page_up; - const char* half_page_down; - const char* page_bottom; - const char* peer_list_up; - const char* peer_list_down; + const char* self; + const char* next_tab; + const char* prev_tab; + const char* scroll_line_up; + const char* scroll_line_down; + const char* half_page_up; + const char* half_page_down; + const char* page_bottom; + const char* peer_list_up; + const char* peer_list_down; const char* toggle_peerlist; } key_strings = { - "keys", - "next_tab", - "prev_tab", - "scroll_line_up", - "scroll_line_down", - "half_page_up", - "half_page_down", - "page_bottom", - "peer_list_up", - "peer_list_down", + "keys", + "next_tab", + "prev_tab", + "scroll_line_up", + "scroll_line_down", + "half_page_up", + "half_page_down", + "page_bottom", + "peer_list_up", + "peer_list_down", "toggle_peerlist", }; diff --git a/src/windows.c b/src/windows.c index fa476f6..c9f3ecf 100644 --- a/src/windows.c +++ b/src/windows.c @@ -370,10 +370,12 @@ void on_window_resize(void) if (w->help->active) wclear(w->help->win); - if (w->is_groupchat) + if (w->is_groupchat) { delwin(w->chatwin->sidebar); - else + w->chatwin->sidebar = NULL; + } else { delwin(w->stb->topline); + } delwin(w->chatwin->linewin); delwin(w->chatwin->history); @@ -382,12 +384,14 @@ void on_window_resize(void) w->window = newwin(y2, x2, 0, 0); w->chatwin->linewin = subwin(w->window, CHATBOX_HEIGHT, x2, y2 - CHATBOX_HEIGHT, 0); - if (w->is_groupchat) { + if (w->show_peerlist) { w->chatwin->history = subwin(w->window, y2 - CHATBOX_HEIGHT + 1, x2 - SIDEBAR_WIDTH - 1, 0, 0); w->chatwin->sidebar = subwin(w->window, y2 - CHATBOX_HEIGHT + 1, SIDEBAR_WIDTH, 0, x2 - SIDEBAR_WIDTH); } else { w->chatwin->history = subwin(w->window, y2 - CHATBOX_HEIGHT + 1, x2, 0, 0); - w->stb->topline = subwin(w->window, 2, x2, 0, 0); + + if (w->is_chat) + w->stb->topline = subwin(w->window, 2, x2, 0, 0); } #ifdef AUDIO