Use fg for slider.

This commit is contained in:
Nicholas Marriott
2024-10-31 14:12:32 +00:00
parent 561441fa54
commit 3fed73d86b
2 changed files with 17 additions and 17 deletions

View File

@@ -1016,19 +1016,21 @@ screen_redraw_draw_scrollbar(struct screen_redraw_ctx *ctx,
struct client *c = ctx->c;
struct window *w = wp->window;
struct tty *tty = &c->tty;
struct grid_cell gc;
struct grid_cell gc, slgc, *gcp;
u_int i, j, sb_w = PANE_SCROLLBARS_WIDTH;
u_int pad_col = 0;
int fg, bg, px, py, ox = ctx->ox, oy = ctx->oy;
int px, py, ox = ctx->ox, oy = ctx->oy;
int sb_pad = PANE_SCROLLBARS_PADDING, sx = ctx->sx;
int sy = ctx->sy, xoff = wp->xoff, yoff = wp->yoff;
/* Set up default colour. */
/* Set up default style. */
style_apply(&gc, w->options, "pane-scrollbars-style", NULL);
fg = gc.fg;
bg = gc.bg;
utf8_set(&gc.data, ' ');
/* Set up style for slider. */
memcpy(&slgc, &gc, sizeof slgc);
slgc.bg = gc.fg;
if (sb_pad != 0) {
if (sb_pos == PANE_SCROLLBARS_RIGHT)
pad_col = 0;
@@ -1048,15 +1050,11 @@ screen_redraw_draw_scrollbar(struct screen_redraw_ctx *ctx,
tty_cell(tty, &grid_default_cell,
&grid_default_cell, NULL, NULL);
} else {
if (j >= slider_y &&
j < slider_y + slider_h) {
gc.bg = fg;
gc.fg = bg;
} else {
gc.bg = bg;
gc.fg = fg;
}
tty_cell(tty, &gc, &grid_default_cell, NULL,
if (j >= slider_y && j < slider_y + slider_h)
gcp = &slgc;
else
gcp = &gc;
tty_cell(tty, gcp, &grid_default_cell, NULL,
NULL);
}
}