1
0
mirror of https://github.com/Tha14/toxic.git synced 2025-07-02 05:56:45 +02:00

refactor groupchats to allow scrolling

This commit is contained in:
Jfreegman
2014-03-25 08:21:50 -04:00
parent 2f981ecb12
commit a5ce17f44e
10 changed files with 148 additions and 128 deletions

View File

@ -793,12 +793,14 @@ static void chat_onDraw(ToxWindow *self, Tox *m)
static void chat_onInit(ToxWindow *self, Tox *m)
{
curs_set(1);
int x2, y2;
getmaxyx(self->window, y2, x2);
self->x = x2;
/* Init statusbar info */
StatusBar *statusbar = self->stb;
statusbar->status = tox_get_user_status(m, self->num);
statusbar->is_online = tox_get_friend_connection_status(m, self->num) == 1;
@ -809,6 +811,7 @@ static void chat_onInit(ToxWindow *self, Tox *m)
/* Init subwindows */
ChatContext *ctx = self->chatwin;
statusbar->topline = subwin(self->window, 2, x2, 0, 0);
ctx->history = subwin(self->window, y2-CHATBOX_HEIGHT+1, x2, 0, 0);
scrollok(ctx->history, 1);