diff options
author | nicm <nicm> | 2020-05-16 15:01:30 +0000 |
---|---|---|
committer | nicm <nicm> | 2020-05-16 15:01:30 +0000 |
commit | f03b61131b3407929fea187a309fb336017791d1 (patch) | |
tree | 13ce42b0be5a19adab996184230cd0c472c9dccd /status.c | |
parent | 0487029fc5f39d49e37c8821f4427565b9969671 (diff) | |
download | rtmux-f03b61131b3407929fea187a309fb336017791d1.tar.gz rtmux-f03b61131b3407929fea187a309fb336017791d1.tar.bz2 rtmux-f03b61131b3407929fea187a309fb336017791d1.zip |
Drop having a separate type for style options and make them all strings,
which allows formats to be expanded. Any styles without a '#{' are still
validated when they are set but any with a '#{' are not. Formats are not
expanded usefully in many cases yet, that will be changed later.
To make this work, a few other changes:
- set-option -a with a style option automatically appends a ",".
- OSC 10 and 11 don't set the window-style option anymore, instead the
fg and bg are stored in the pane struct and act as the defaults that
can be overridden by window-style.
- status-fg and -bg now override status-style instead of trying to keep
them in sync.
Diffstat (limited to 'status.c')
-rw-r--r-- | status.c | 16 |
1 files changed, 11 insertions, 5 deletions
@@ -321,7 +321,7 @@ status_redraw(struct client *c) struct screen_write_ctx ctx; struct grid_cell gc; u_int lines, i, n, width = c->tty.sx; - int flags, force = 0, changed = 0; + int flags, force = 0, changed = 0, fg, bg; struct options_entry *o; union options_value *ov; struct format_tree *ft; @@ -339,7 +339,13 @@ status_redraw(struct client *c) return (1); /* Set up default colour. */ - style_apply(&gc, s->options, "status-style"); + style_apply(&gc, s->options, "status-style", NULL); + fg = options_get_number(s->options, "status-fg"); + if (fg != 8) + gc.fg = fg; + bg = options_get_number(s->options, "status-bg"); + if (bg != 8) + gc.bg = bg; if (!grid_cells_equal(&gc, &sl->style)) { force = 1; memcpy(&sl->style, &gc, sizeof sl->style); @@ -490,7 +496,7 @@ status_message_redraw(struct client *c) if (len > c->tty.sx) len = c->tty.sx; - style_apply(&gc, s->options, "message-style"); + style_apply(&gc, s->options, "message-style", NULL); screen_write_start(&ctx, NULL, sl->active); screen_write_fast_copy(&ctx, &sl->screen, 0, 0, c->tty.sx, lines - 1); @@ -633,9 +639,9 @@ status_prompt_redraw(struct client *c) screen_init(sl->active, c->tty.sx, lines, 0); if (c->prompt_mode == PROMPT_COMMAND) - style_apply(&gc, s->options, "message-command-style"); + style_apply(&gc, s->options, "message-command-style", NULL); else - style_apply(&gc, s->options, "message-style"); + style_apply(&gc, s->options, "message-style", NULL); memcpy(&cursorgc, &gc, sizeof cursorgc); cursorgc.attr ^= GRID_ATTR_REVERSE; |