diff options
author | nicm <nicm> | 2019-07-01 06:56:00 +0000 |
---|---|---|
committer | nicm <nicm> | 2019-07-01 06:56:00 +0000 |
commit | 2da050413c17e587be8bede710112096ce6b5f5a (patch) | |
tree | d551271f4c62a338d22daee38865ffb3bd043937 /format-draw.c | |
parent | cf30e0f9357b7e42491645a87eeae06ffb8e8066 (diff) | |
download | rtmux-2da050413c17e587be8bede710112096ce6b5f5a.tar.gz rtmux-2da050413c17e587be8bede710112096ce6b5f5a.tar.bz2 rtmux-2da050413c17e587be8bede710112096ce6b5f5a.zip |
Add a "fill" style attribute to clear the entire format drawing area in
a colour, GitHub issue 1815.
Diffstat (limited to 'format-draw.c')
-rw-r--r-- | format-draw.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/format-draw.c b/format-draw.c index b589ca5e..bb5c65fb 100644 --- a/format-draw.c +++ b/format-draw.c @@ -511,8 +511,9 @@ format_draw(struct screen_write_ctx *octx, const struct grid_cell *base, u_int ocx = os->cx, ocy = os->cy, i, width[TOTAL]; u_int map[] = { LEFT, LEFT, CENTRE, RIGHT }; int focus_start = -1, focus_end = -1; - int list_state = -1; + int list_state = -1, fill = -1; enum style_align list_align = STYLE_ALIGN_DEFAULT; + struct grid_cell gc; struct style sy; struct utf8_data *ud = &sy.gc.data; const char *cp, *end; @@ -590,6 +591,10 @@ format_draw(struct screen_write_ctx *octx, const struct grid_cell *base, style_tostring(&sy)); free(tmp); + /* If this style has a fill colour, store it for later. */ + if (sy.fill != 8) + fill = sy.fill; + /* Check the list state. */ switch (sy.list) { case STYLE_LIST_ON: @@ -711,6 +716,14 @@ format_draw(struct screen_write_ctx *octx, const struct grid_cell *base, fr->argument, names[fr->index], fr->start, fr->end); } + /* Clear the available area. */ + if (fill != -1) { + memcpy(&gc, &grid_default_cell, sizeof gc); + gc.bg = fill; + for (i = 0; i < available; i++) + screen_write_putc(octx, &gc, ' '); + } + /* * Draw the screens. How they are arranged depends on where the list * appearsq. |