diff options
author | okan <okan> | 2013-05-14 12:35:56 +0000 |
---|---|---|
committer | okan <okan> | 2013-05-14 12:35:56 +0000 |
commit | c637a5404809f3856e5f9b8890f6ef0fe8f55fe8 (patch) | |
tree | 2f4816fc6c911b0e7126ae4247ba6cd3a55b3702 /menu.c | |
parent | 112f616d1d3a6377407071f4327c1a2b31cb6e9f (diff) | |
download | cwm-c637a5404809f3856e5f9b8890f6ef0fe8f55fe8.tar.gz cwm-c637a5404809f3856e5f9b8890f6ef0fe8f55fe8.tar.xz cwm-c637a5404809f3856e5f9b8890f6ef0fe8f55fe8.zip |
- let callers of font_draw figure out (and pass) the color instead of an
'active' flag. - use strlen() inside of font_draw; the only instance where it wasn't used happened to be ignored on a subsequent draw.
Diffstat (limited to 'menu.c')
-rw-r--r-- | menu.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/menu.c b/menu.c index 5b545a2..c2bd37c 100644 --- a/menu.c +++ b/menu.c @@ -419,7 +419,7 @@ menu_draw(struct screen_ctx *sc, struct menu_ctx *mc, struct menu_q *menuq, mc->width, mc->height); if (mc->hasprompt) { - font_draw(sc, mc->dispstr, strlen(mc->dispstr), sc->menuwin, 0, + font_draw(sc, mc->dispstr, sc->menuwin, CWM_COLOR_MENU_FONT, 0, sc->xftfont->ascent); n = 1; } else @@ -434,8 +434,7 @@ menu_draw(struct screen_ctx *sc, struct menu_ctx *mc, struct menu_q *menuq, if (mc->y + y > xine.h) break; - font_draw(sc, text, MIN(strlen(text), MENU_MAXENTRY), - sc->menuwin, 0, 0, y); + font_draw(sc, text, sc->menuwin, CWM_COLOR_MENU_FONT, 0, y); n++; } if (mc->hasprompt && n > 1 && (mc->searchstr[0] != '\0')) { @@ -466,7 +465,8 @@ menu_draw_entry(struct screen_ctx *sc, struct menu_ctx *mc, XftDrawRect(sc->xftdraw, &sc->xftcolor[color], 0, (sc->xftfont->height + 1) * entry, mc->width, (sc->xftfont->height + 1) + sc->xftfont->descent); - font_draw(sc, text, strlen(text), sc->menuwin, active, + color = active ? CWM_COLOR_MENU_FONT_SEL : CWM_COLOR_MENU_FONT; + font_draw(sc, text, sc->menuwin, color, 0, (sc->xftfont->height + 1) * entry + sc->xftfont->ascent + 1); } |