From ee123c248951450100475717f5bd45f292d9bb4d Mon Sep 17 00:00:00 2001 From: nicm Date: Sun, 19 Apr 2015 21:05:27 +0000 Subject: Support setting the default window and pane background colours (window and active pane via window-style and window-active-style options, an individual pane by a new select-pane -P flag). From J Raynor. --- screen-redraw.c | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) (limited to 'screen-redraw.c') diff --git a/screen-redraw.c b/screen-redraw.c index c2b2ece6..e3369b82 100644 --- a/screen-redraw.c +++ b/screen-redraw.c @@ -266,7 +266,7 @@ screen_redraw_pane(struct client *c, struct window_pane *wp) yoff++; for (i = 0; i < wp->sy; i++) - tty_draw_line(&c->tty, wp->screen, i, wp->xoff, yoff); + tty_draw_pane(&c->tty, wp, i, wp->xoff, yoff); tty_reset(&c->tty); } @@ -323,9 +323,9 @@ screen_redraw_draw_borders(struct client *c, int status, u_int top) small && i > msgx && j == msgy) continue; if (screen_redraw_check_active(i, j, type, w, wp)) - tty_attributes(tty, &active_gc); + tty_attributes(tty, &active_gc, NULL); else - tty_attributes(tty, &other_gc); + tty_attributes(tty, &other_gc, NULL); tty_cursor(tty, i, top + j); tty_putc(tty, CELL_BORDERS[type]); } @@ -333,7 +333,7 @@ screen_redraw_draw_borders(struct client *c, int status, u_int top) if (small) { memcpy(&msg_gc, &grid_default_cell, sizeof msg_gc); - tty_attributes(tty, &msg_gc); + tty_attributes(tty, &msg_gc, NULL); tty_cursor(tty, msgx, msgy); tty_puts(tty, msg); } @@ -346,15 +346,13 @@ screen_redraw_draw_panes(struct client *c, u_int top) struct window *w = c->session->curw->window; struct tty *tty = &c->tty; struct window_pane *wp; - struct screen *s; u_int i; TAILQ_FOREACH(wp, &w->panes, entry) { if (!window_pane_visible(wp)) continue; - s = wp->screen; for (i = 0; i < wp->sy; i++) - tty_draw_line(tty, s, i, wp->xoff, top + wp->yoff); + tty_draw_pane(tty, wp, i, wp->xoff, top + wp->yoff); if (c->flags & CLIENT_IDENTIFY) screen_redraw_draw_number(c, wp); } @@ -367,9 +365,9 @@ screen_redraw_draw_status(struct client *c, u_int top) struct tty *tty = &c->tty; if (top) - tty_draw_line(tty, &c->status, 0, 0, 0); + tty_draw_line(tty, NULL, &c->status, 0, 0, 0); else - tty_draw_line(tty, &c->status, 0, 0, tty->sy - 1); + tty_draw_line(tty, NULL, &c->status, 0, 0, tty->sy - 1); } /* Draw number on a pane. */ @@ -411,7 +409,7 @@ screen_redraw_draw_number(struct client *c, struct window_pane *wp) colour_set_bg(&gc, active_colour); else colour_set_bg(&gc, colour); - tty_attributes(tty, &gc); + tty_attributes(tty, &gc, wp); for (ptr = buf; *ptr != '\0'; ptr++) { if (*ptr < '0' || *ptr > '9') continue; @@ -438,7 +436,7 @@ draw_text: colour_set_fg(&gc, active_colour); else colour_set_fg(&gc, colour); - tty_attributes(tty, &gc); + tty_attributes(tty, &gc, wp); tty_puts(tty, buf); tty_cursor(tty, 0, 0); -- cgit v1.2.3