1
0
Fork 0
forked from murx/irc9

Use the full chat pane width for the topic divider

This commit is contained in:
Johannes Findeisen 2026-11-29 06:31:21 +01:00
commit 6ed9931044
2 changed files with 11 additions and 16 deletions

View file

@ -112,7 +112,7 @@ Build yours by copying `irc9rc-example` to `irc9rc` next to the binary (or to
[irc9] irc.example / #general [irc9] irc.example / #general
/----------------------\---------------------------------------- /----------------------\----------------------------------------
|* irc.example | Topic: General discussion |* irc.example | Topic: General discussion
| | --------------------------------------- | |----------------------------------------
| |-#general | | |-#general |
| |-#help(3) | | |-#help(3) |
| \-alice | [10:21] <alice> hello there | \-alice | [10:21] <alice> hello there

25
irc9.c
View file

@ -2553,6 +2553,15 @@ static void draw_title(void)
fputs("\033[0m", stdout); fputs("\033[0m", stdout);
} }
static void draw_pane_divider(int row)
{
int left = lines > 5 && treew >= 2 ? treew : 0;
terminal_move(row, left);
terminal_accent();
terminal_repeat('-', cols - left);
fputs("\033[0m", stdout);
}
/* Include the topic divider when calculating the chat pane height. */ /* Include the topic divider when calculating the chat pane height. */
static int layout_topic(int draw) static int layout_topic(int draw)
{ {
@ -2576,12 +2585,7 @@ static int layout_topic(int draw)
if (draw && row < height) draw_irc_text(chat_top + row, left, text, width); if (draw && row < height) draw_irc_text(chat_top + row, left, text, width);
free(text); free(text);
} }
if (draw && divider) { if (draw && divider) draw_pane_divider(chat_top + height);
terminal_move(chat_top + height, left);
terminal_accent();
terminal_repeat('-', width);
fputs("\033[0m", stdout);
}
return height + divider; return height + divider;
} }
@ -2622,15 +2626,6 @@ static void draw_main(void)
} }
} }
static void draw_pane_divider(int row)
{
int left = lines > 5 && treew >= 2 ? treew : 0;
terminal_move(row, left);
terminal_accent();
terminal_repeat('-', cols - left);
fputs("\033[0m", stdout);
}
static void draw_status(void) static void draw_status(void)
{ {
status_minute = time(NULL) / 60; status_minute = time(NULL) / 60;