mirror of
https://github.com/Tha14/toxic.git
synced 2024-11-23 03:03:02 +01:00
correctly reposition call infobox on resize
This commit is contained in:
parent
3e22c9b829
commit
893cfaa543
@ -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;
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user