diff options
author | Nicholas Marriott <nicm@openbsd.org> | 2009-08-05 16:26:38 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@openbsd.org> | 2009-08-05 16:26:38 +0000 |
commit | bcddddf98d46bb9aef919d8e93b7328a7b040140 (patch) | |
tree | 08371106a8988983ca50dc6af2b8071116e798a3 /status.c | |
parent | 12ef3ceda13f9ae4c77384f98e6f145322971e69 (diff) |
If colours are not supported by the terminal, try to emulate a coloured
background by setting or clearing the reverse attribute.
This makes a few applications which don't use the reverse attribute themselves
a little happier, and allows the status, message and mode options to have
default attributes and fg/bg options that work as expected when set as reverse.
Diffstat (limited to 'status.c')
-rw-r--r-- | status.c | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -64,8 +64,8 @@ status_redraw(struct client *c) if (gettimeofday(&c->status_timer, NULL) != 0) fatal("gettimeofday"); memcpy(&stdgc, &grid_default_cell, sizeof gc); - stdgc.bg = options_get_number(&s->options, "status-fg"); - stdgc.fg = options_get_number(&s->options, "status-bg"); + stdgc.fg = options_get_number(&s->options, "status-fg"); + stdgc.bg = options_get_number(&s->options, "status-bg"); stdgc.attr |= options_get_number(&s->options, "status-attr"); yy = c->tty.sy - 1; @@ -563,8 +563,8 @@ status_message_redraw(struct client *c) len = c->tty.sx; memcpy(&gc, &grid_default_cell, sizeof gc); - gc.bg = options_get_number(&s->options, "message-fg"); - gc.fg = options_get_number(&s->options, "message-bg"); + gc.fg = options_get_number(&s->options, "message-fg"); + gc.bg = options_get_number(&s->options, "message-bg"); gc.attr |= options_get_number(&s->options, "message-attr"); screen_write_start(&ctx, NULL, &c->status); @@ -662,8 +662,8 @@ status_prompt_redraw(struct client *c) len = c->tty.sx; memcpy(&gc, &grid_default_cell, sizeof gc); - gc.bg = options_get_number(&s->options, "message-fg"); - gc.fg = options_get_number(&s->options, "message-bg"); + gc.fg = options_get_number(&s->options, "message-fg"); + gc.bg = options_get_number(&s->options, "message-bg"); gc.attr |= options_get_number(&s->options, "message-attr"); screen_write_start(&ctx, NULL, &c->status); |