1
0
mirror of https://github.com/tmux/tmux.git synced 2025-03-28 17:48:48 +00:00

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);
}
}

8
tmux.1
View File

@ -5050,15 +5050,17 @@ If set to
the pane is narrowed only when the scrollbar is visible.
.Pp
See also
.Xr pane-scrollbar-style .
.Xr pane-scrollbars-style .
.Pp
.It Ic pane-scrollbar-style Ar style
Set the pane scrollbar style for the currently active pane.
.It Ic pane-scrollbars-style Ar style
Set the scrollbars style.
For how to specify
.Ar style ,
see the
.Sx STYLES
section.
The foreground colour is used for the slider, the background for the rest of the
scrollbar.
Attributes are ignored.
.Pp
.It Xo Ic pane-scrollbars-position