diff --git a/sxiv.1 b/sxiv.1 index eff3d666..a2a04dfb 100644 --- a/sxiv.1 +++ b/sxiv.1 @@ -382,7 +382,10 @@ The following X resources are supported: Color of the window background and bar foreground .TP .B foreground -Color of the window foreground and bar background +Color of the window foreground +.TP +.B barBackground +Color of the bar background .TP .B font Name of Xft bar font diff --git a/sxiv.h b/sxiv.h index 707eba71..d4de4305 100644 --- a/sxiv.h +++ b/sxiv.h @@ -409,6 +409,7 @@ struct win { XftColor bg; XftColor fg; + XftColor bbg; int x; int y; diff --git a/window.c b/window.c index 6f9a3906..2d5e0a96 100644 --- a/window.c +++ b/window.c @@ -92,7 +92,7 @@ const char* win_res(XrmDatabase db, const char *name, const char *def) void win_init(win_t *win) { win_env_t *e; - const char *bg, *fg, *f; + const char *bg, *fg, *bbg, *f; char *res_man; XrmDatabase db; @@ -121,8 +121,10 @@ void win_init(win_t *win) bg = win_res(db, RES_CLASS ".background", "white"); fg = win_res(db, RES_CLASS ".foreground", "black"); + bbg = win_res(db, RES_CLASS ".barBackground", "white"); win_alloc_color(e, bg, &win->bg); win_alloc_color(e, fg, &win->fg); + win_alloc_color(e, bbg, &win->bbg); win->bar.l.size = BAR_L_LEN; win->bar.r.size = BAR_R_LEN; @@ -397,7 +399,7 @@ void win_draw_bar(win_t *win) d = XftDrawCreate(e->dpy, win->buf.pm, DefaultVisual(e->dpy, e->scr), DefaultColormap(e->dpy, e->scr)); - XSetForeground(e->dpy, gc, win->fg.pixel); + XSetForeground(e->dpy, gc, win->bbg.pixel); XFillRectangle(e->dpy, win->buf.pm, gc, 0, win->h, win->w, win->bar.h); XSetForeground(e->dpy, gc, win->bg.pixel); @@ -408,12 +410,12 @@ void win_draw_bar(win_t *win) return; x = win->w - tw - H_TEXT_PAD; w -= tw; - win_draw_text(win, d, &win->bg, x, y, r->buf, len, tw); + win_draw_text(win, d, &win->fg, x, y, r->buf, len, tw); } if ((len = strlen(l->buf)) > 0) { x = H_TEXT_PAD; w -= 2 * H_TEXT_PAD; /* gap between left and right parts */ - win_draw_text(win, d, &win->bg, x, y, l->buf, len, w); + win_draw_text(win, d, &win->fg, x, y, l->buf, len, w); } XftDrawDestroy(d); }