Separate channel topics from chat with an accent divider
This commit is contained in:
parent
c4f1ce74d5
commit
9c7390bad8
1 changed files with 12 additions and 4 deletions
16
irc9.c
16
irc9.c
|
|
@ -2474,7 +2474,7 @@ static void draw_title(void)
|
|||
fputs("\033[0m", stdout);
|
||||
}
|
||||
|
||||
/* Use the same topic height for drawing and paging the chat pane. */
|
||||
/* Include the topic divider when calculating the chat pane height. */
|
||||
static int layout_topic(int draw)
|
||||
{
|
||||
int width = cols - treew - (copy_view ? 0 : 2);
|
||||
|
|
@ -2488,14 +2488,22 @@ static int layout_topic(int draw)
|
|||
int count = 0;
|
||||
push_wrapped(rows, &count, MAXWRAPROWS, topic, width);
|
||||
|
||||
int limit = mainh > 1 ? mainh - 1 : 1;
|
||||
int divider = mainh >= 3;
|
||||
int limit = mainh > 1 ? mainh - 1 - divider : 1;
|
||||
int left = treew + (copy_view ? 0 : 1);
|
||||
int height = count < limit ? count : limit;
|
||||
for (int row = 0; row < count; row++) {
|
||||
char *text = rows[count - 1 - row];
|
||||
if (draw && row < height) draw_irc_text(row + 1, treew + (copy_view ? 0 : 1), text, width);
|
||||
if (draw && row < height) draw_irc_text(row + 1, left, text, width);
|
||||
free(text);
|
||||
}
|
||||
return height;
|
||||
if (draw && divider) {
|
||||
terminal_move(height + 1, left);
|
||||
terminal_accent();
|
||||
terminal_repeat('-', width);
|
||||
fputs("\033[0m", stdout);
|
||||
}
|
||||
return height + divider;
|
||||
}
|
||||
|
||||
static void draw_main(void)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue