diff options
author | Anselm R. Garbe <arg@10kloc.org> | 2006-08-24 09:41:41 +0200 |
---|---|---|
committer | Anselm R. Garbe <arg@10kloc.org> | 2006-08-24 09:41:41 +0200 |
commit | c976bc6c2cbc2f197806259b58a6c6ff2d154284 (patch) | |
tree | ab76b3fc8ba593f5c66abc50e8d4e11b5c27e5e5 /draw.c | |
parent | 2e834e941f695481894123e0665416f96333653b (diff) | |
download | dwm-c976bc6c2cbc2f197806259b58a6c6ff2d154284.tar.gz dwm-c976bc6c2cbc2f197806259b58a6c6ff2d154284.tar.bz2 dwm-c976bc6c2cbc2f197806259b58a6c6ff2d154284.zip |
found less intrusive way
Diffstat (limited to 'draw.c')
-rw-r--r-- | draw.c | 18 |
1 files changed, 12 insertions, 6 deletions
@@ -22,7 +22,7 @@ textnw(const char *text, unsigned int len) } static void -drawtext(const char *text, Bool invert, Bool underline) +drawtext(const char *text, Bool invert, Bool highlight) { int x, y, w, h; static char buf[256]; @@ -85,12 +85,18 @@ drawtext(const char *text, Bool invert, Bool underline) XChangeGC(dpy, dc.gc, GCForeground | GCBackground | GCFont, &gcv); XDrawString(dpy, dc.drawable, dc.gc, x, y, buf, len); } - if(underline) { - points[0].x = dc.x + (h / 2) - 1; - points[0].y = dc.y + dc.h - 3; - points[1].x = dc.w - h + 2; + if(highlight) { + points[0].x = dc.x + 1; + points[0].y = dc.y + 1; + points[1].x = dc.w - 3; points[1].y = 0; - XDrawLines(dpy, dc.drawable, dc.gc, points, 2, CoordModePrevious); + points[2].x = 0; + points[2].y = dc.h - 3; + points[3].x = -(dc.w - 3); + points[3].y = 0; + points[4].x = 0; + points[4].y = -(dc.h - 3); + XDrawLines(dpy, dc.drawable, dc.gc, points, 5, CoordModePrevious); } } |