summary refs log tree commit diff
path: root/font.c
diff options
context:
space:
mode:
authorokan <okan>2013-05-14 12:35:56 +0000
committerokan <okan>2013-05-14 12:35:56 +0000
commitc637a5404809f3856e5f9b8890f6ef0fe8f55fe8 (patch)
tree2f4816fc6c911b0e7126ae4247ba6cd3a55b3702 /font.c
parent112f616d1d3a6377407071f4327c1a2b31cb6e9f (diff)
downloadcwm-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 'font.c')
-rw-r--r--font.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/font.c b/font.c
index c69d30c..e2b68c0 100644
--- a/font.c
+++ b/font.c
@@ -75,13 +75,10 @@ font_width(XftFont *xftfont, const char *text, int len)
 }
 
 void
-font_draw(struct screen_ctx *sc, const char *text, int len,
-    Drawable d, int active, int x, int y)
+font_draw(struct screen_ctx *sc, const char *text,
+    Drawable d, int color, int x, int y)
 {
-	int	 color;
-
-	color = active ? CWM_COLOR_MENU_FONT_SEL : CWM_COLOR_MENU_FONT;
 	XftDrawChange(sc->xftdraw, d);
 	XftDrawStringUtf8(sc->xftdraw, &sc->xftcolor[color], sc->xftfont, x, y,
-	    (const FcChar8*)text, len);
+	    (const FcChar8*)text, strlen(text));
 }