1
0
mirror of https://github.com/Tha14/toxic.git synced 2024-11-26 22:03:27 +01:00

fix groupchat resizing when peerlist is off

This commit is contained in:
Jfreegman 2014-10-08 14:53:09 -04:00
parent 2094186c0f
commit 55ada8ad2f
No known key found for this signature in database
GPG Key ID: 3627F3144076AE63
2 changed files with 28 additions and 24 deletions

View File

@ -82,28 +82,28 @@ static void ui_defaults(struct user_settings* settings)
} }
static const struct keys_strings { static const struct keys_strings {
const char* self; const char* self;
const char* next_tab; const char* next_tab;
const char* prev_tab; const char* prev_tab;
const char* scroll_line_up; const char* scroll_line_up;
const char* scroll_line_down; const char* scroll_line_down;
const char* half_page_up; const char* half_page_up;
const char* half_page_down; const char* half_page_down;
const char* page_bottom; const char* page_bottom;
const char* peer_list_up; const char* peer_list_up;
const char* peer_list_down; const char* peer_list_down;
const char* toggle_peerlist; const char* toggle_peerlist;
} key_strings = { } key_strings = {
"keys", "keys",
"next_tab", "next_tab",
"prev_tab", "prev_tab",
"scroll_line_up", "scroll_line_up",
"scroll_line_down", "scroll_line_down",
"half_page_up", "half_page_up",
"half_page_down", "half_page_down",
"page_bottom", "page_bottom",
"peer_list_up", "peer_list_up",
"peer_list_down", "peer_list_down",
"toggle_peerlist", "toggle_peerlist",
}; };

View File

@ -370,10 +370,12 @@ void on_window_resize(void)
if (w->help->active) if (w->help->active)
wclear(w->help->win); wclear(w->help->win);
if (w->is_groupchat) if (w->is_groupchat) {
delwin(w->chatwin->sidebar); delwin(w->chatwin->sidebar);
else w->chatwin->sidebar = NULL;
} else {
delwin(w->stb->topline); delwin(w->stb->topline);
}
delwin(w->chatwin->linewin); delwin(w->chatwin->linewin);
delwin(w->chatwin->history); delwin(w->chatwin->history);
@ -382,12 +384,14 @@ void on_window_resize(void)
w->window = newwin(y2, x2, 0, 0); w->window = newwin(y2, x2, 0, 0);
w->chatwin->linewin = subwin(w->window, CHATBOX_HEIGHT, x2, y2 - CHATBOX_HEIGHT, 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->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); w->chatwin->sidebar = subwin(w->window, y2 - CHATBOX_HEIGHT + 1, SIDEBAR_WIDTH, 0, x2 - SIDEBAR_WIDTH);
} else { } else {
w->chatwin->history = subwin(w->window, y2 - CHATBOX_HEIGHT + 1, x2, 0, 0); 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 #ifdef AUDIO