diff options
author | okan | 2012-12-17 02:53:29 +0000 |
---|---|---|
committer | okan | 2012-12-17 02:53:29 +0000 |
commit | 03176d219db80f5577b1945a0b32533a5263b933 (patch) | |
tree | 2d1617dea4be39bf1aa03ad2efd3733efc485f01 /font.c | |
parent | 413da1eebb4612d1fe0c55b2b9a5957b5379285d (diff) | |
download | cwm-03176d219db80f5577b1945a0b32533a5263b933.tar.gz |
knf
Diffstat (limited to '')
-rw-r--r-- | font.c | 17 |
1 files changed, 9 insertions, 8 deletions
@@ -15,7 +15,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $OpenBSD: font.c,v 1.21 2012/12/17 02:28:45 okan Exp $ + * $OpenBSD: font.c,v 1.22 2012/12/17 02:53:29 okan Exp $ */ #include <sys/param.h> @@ -51,8 +51,8 @@ font_height(struct screen_ctx *sc) void font_init(struct screen_ctx *sc, const char *name, const char **color) { - int i; - XRenderColor c; + int i; + XRenderColor c; sc->xftdraw = XftDrawCreate(X_Dpy, sc->rootwin, DefaultVisual(X_Dpy, sc->which), DefaultColormap(X_Dpy, sc->which)); @@ -62,7 +62,8 @@ font_init(struct screen_ctx *sc, const char *name, const char **color) sc->font = XftFontOpenName(X_Dpy, sc->which, name); if (sc->font == NULL) errx(1, "XftFontOpenName"); - for(i = 0; i < CWM_COLOR_MENU_MAX; i++) { + + for (i = 0; i < CWM_COLOR_MENU_MAX; i++) { if (*color[i] == '\0') break; if (!XftColorAllocName(X_Dpy, DefaultVisual(X_Dpy, sc->which), @@ -74,11 +75,11 @@ font_init(struct screen_ctx *sc, const char *name, const char **color) return; xu_xorcolor(sc->xftcolor[CWM_COLOR_MENU_BG].color, - sc->xftcolor[CWM_COLOR_MENU_FG].color, &c); + sc->xftcolor[CWM_COLOR_MENU_FG].color, &c); xu_xorcolor(sc->xftcolor[CWM_COLOR_MENU_FONT].color, c, &c); if (!XftColorAllocValue(X_Dpy, DefaultVisual(X_Dpy, sc->which), - DefaultColormap(X_Dpy, sc->which), &c, - &sc->xftcolor[CWM_COLOR_MENU_FONT_SEL])) + DefaultColormap(X_Dpy, sc->which), &c, + &sc->xftcolor[CWM_COLOR_MENU_FONT_SEL])) errx(1, "XftColorAllocValue"); } @@ -97,7 +98,7 @@ void font_draw(struct screen_ctx *sc, const char *text, int len, Drawable d, int active, int x, int y) { - int color; + int color; color = active ? CWM_COLOR_MENU_FONT_SEL : CWM_COLOR_MENU_FONT; XftDrawChange(sc->xftdraw, d); |