Try to show a better preview of sessions and windows in tree mode.

This commit is contained in:
nicm
2017-06-30 22:24:08 +00:00
parent 8b0fd63ddb
commit 7247553c77
4 changed files with 177 additions and 6 deletions

View File

@ -387,9 +387,9 @@ screen_write_copy(struct screen_write_ctx *ctx, struct screen *src, u_int px,
}
}
/* Draw a line on screen. */
/* Draw a horizontal line on screen. */
void
screen_write_line(struct screen_write_ctx *ctx, u_int nx, int left, int right)
screen_write_hline(struct screen_write_ctx *ctx, u_int nx, int left, int right)
{
struct screen *s = ctx->s;
struct grid_cell gc;
@ -409,6 +409,31 @@ screen_write_line(struct screen_write_ctx *ctx, u_int nx, int left, int right)
screen_write_cursormove(ctx, cx, cy);
}
/* Draw a horizontal line on screen. */
void
screen_write_vline(struct screen_write_ctx *ctx, u_int ny, int top, int bottom)
{
struct screen *s = ctx->s;
struct grid_cell gc;
u_int cx, cy, i;
cx = s->cx;
cy = s->cy;
memcpy(&gc, &grid_default_cell, sizeof gc);
gc.attr |= GRID_ATTR_CHARSET;
screen_write_putc(ctx, &gc, top ? 'w' : 'x');
for (i = 1; i < ny - 1; i++) {
screen_write_cursormove(ctx, cx, cy + i);
screen_write_putc(ctx, &gc, 'x');
}
screen_write_cursormove(ctx, cx, cy + ny);
screen_write_putc(ctx, &gc, bottom ? 'v' : 'x');
screen_write_cursormove(ctx, cx, cy);
}
/* Draw a box on screen. */
void
screen_write_box(struct screen_write_ctx *ctx, u_int nx, u_int ny)