allow configurable menu font color; from Alexander Polakov with a tweak

from me.

ok oga@
This commit is contained in:
okan
2011-09-08 12:35:33 +00:00
parent a262f8e80c
commit 82d31aec1d
6 changed files with 21 additions and 6 deletions

9
font.c
View File

@@ -49,15 +49,20 @@ font_height(struct screen_ctx *sc)
}
void
font_init(struct screen_ctx *sc)
font_init(struct screen_ctx *sc, const char *color)
{
if (sc->xftdraw)
XftDrawDestroy(sc->xftdraw);
sc->xftdraw = XftDrawCreate(X_Dpy, sc->rootwin,
DefaultVisual(X_Dpy, sc->which), DefaultColormap(X_Dpy, sc->which));
if (sc->xftdraw == NULL)
errx(1, "XftDrawCreate");
if (sc->xftcolor.pixel)
XftColorFree(X_Dpy, DefaultVisual(X_Dpy, sc->which),
DefaultColormap(X_Dpy, sc->which), &sc->xftcolor);
if (!XftColorAllocName(X_Dpy, DefaultVisual(X_Dpy, sc->which),
DefaultColormap(X_Dpy, sc->which), "black", &sc->xftcolor))
DefaultColormap(X_Dpy, sc->which), color, &sc->xftcolor))
errx(1, "XftColorAllocName");
}