hirc

IRC client
Log | Files | Refs

commit 397b2b7bd425cf77413346a6aa7c6a1d64f2b4ca
parent 409c1fd6dc61ae69e80611765f49bdb669591f59
Author: hhvn <dev@hhvn.uk>
Date:   Wed, 17 Nov 2021 00:48:38 +0000

config.c ui.c: draw topic in top of main window

Diffstat:
Mconfig.c | 5+++++
Mui.c | 7+++++++
2 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/config.c b/config.c @@ -114,6 +114,11 @@ struct Config config[] = { .numhandle = config_buflist_width, .description = { "Number of columns buflist will take up.", NULL}}, + {"misc.topiccolour", 1, Val_colourpair, + .pair = {99, 88}, + .pairhandle = NULL, + .description = { + "Foreground and background colour of topic bar in main window", NULL}}, {"misc.pingtime", 1, Val_nzunsigned, .num = 200, .numhandle = NULL, diff --git a/ui.c b/ui.c @@ -690,6 +690,7 @@ void ui_draw_main(void) { struct History *p; int y, lines; + long fg, bg; ui_wclear(&windows[Win_main]); @@ -707,6 +708,12 @@ ui_draw_main(void) { wmove(windows[Win_main].window, y, 0); ui_wprintc(&windows[Win_main], 0, "%s\n", p->raw); } + + if (selected.channel && selected.channel->topic) { + config_getr("misc.topiccolour", &fg, &bg); + wmove(windows[Win_main].window, 0, 0); + ui_wprintc(&windows[Win_main], 1, "%c%02d,%02d%s\n", 3 /* ^C */, fg, bg, selected.channel->topic); + } } void