1
0
mirror of https://github.com/Tha14/toxic.git synced 2024-11-13 02:23:01 +01:00

correctly reposition call infobox on resize

This commit is contained in:
Jfreegman 2014-07-01 11:17:52 -04:00
parent 3e22c9b829
commit 893cfaa543
No known key found for this signature in database
GPG Key ID: 3627F3144076AE63
3 changed files with 14 additions and 5 deletions

View File

@ -543,10 +543,6 @@ void chat_onPeerTimeout (ToxWindow *self, ToxAv *av, int call_index)
line_info_add(self, NULL, NULL, NULL, "Peer disconnected; call ended!", SYS_MSG, 0, 0);
}
#define INFOBOX_HEIGHT 7
#define INFOBOX_WIDTH 21
static void init_infobox(ToxWindow *self)
{
ChatContext *ctx = self->chatwin;

View File

@ -358,6 +358,15 @@ void on_window_resize(void)
w->stb->topline = subwin(w->window, 2, x2, 0, 0);
}
#ifdef _SUPPORT_AUDIO
if (ctx->infobox.active) {
delwin(ctx->infobox.win);
ctx->infobox.win = newwin(INFOBOX_HEIGHT, INFOBOX_WIDTH + 1, 1, x2 - INFOBOX_WIDTH);
}
#endif /* #ifdef _SUPPORT_AUDIO */
scrollok(ctx->history, 0);
}
}

View File

@ -147,6 +147,10 @@ struct StatusBar {
};
#ifdef _SUPPORT_AUDIO
#define INFOBOX_HEIGHT 7
#define INFOBOX_WIDTH 21
/* holds display info for audio calls */
struct infobox {
float vad_lvl;
@ -161,7 +165,7 @@ struct infobox {
WINDOW *win;
};
#endif
#endif /* _SUPPORT_AUDIO */
#define MAX_LINE_HIST 128