aewl
changeset 345:977585eb2d35
found less intrusive way
author | Anselm R. Garbe <arg@10kloc.org> |
---|---|
date | Thu, 24 Aug 2006 09:41:41 +0200 |
parents | 93192711a36a |
children | b423154eb7be |
files | draw.c |
diffstat | 1 files changed, 12 insertions(+), 6 deletions(-) [+] |
line diff
1.1 --- a/draw.c Thu Aug 24 09:25:10 2006 +0200 1.2 +++ b/draw.c Thu Aug 24 09:41:41 2006 +0200 1.3 @@ -22,7 +22,7 @@ 1.4 } 1.5 1.6 static void 1.7 -drawtext(const char *text, Bool invert, Bool underline) 1.8 +drawtext(const char *text, Bool invert, Bool highlight) 1.9 { 1.10 int x, y, w, h; 1.11 static char buf[256]; 1.12 @@ -85,12 +85,18 @@ 1.13 XChangeGC(dpy, dc.gc, GCForeground | GCBackground | GCFont, &gcv); 1.14 XDrawString(dpy, dc.drawable, dc.gc, x, y, buf, len); 1.15 } 1.16 - if(underline) { 1.17 - points[0].x = dc.x + (h / 2) - 1; 1.18 - points[0].y = dc.y + dc.h - 3; 1.19 - points[1].x = dc.w - h + 2; 1.20 + if(highlight) { 1.21 + points[0].x = dc.x + 1; 1.22 + points[0].y = dc.y + 1; 1.23 + points[1].x = dc.w - 3; 1.24 points[1].y = 0; 1.25 - XDrawLines(dpy, dc.drawable, dc.gc, points, 2, CoordModePrevious); 1.26 + points[2].x = 0; 1.27 + points[2].y = dc.h - 3; 1.28 + points[3].x = -(dc.w - 3); 1.29 + points[3].y = 0; 1.30 + points[4].x = 0; 1.31 + points[4].y = -(dc.h - 3); 1.32 + XDrawLines(dpy, dc.drawable, dc.gc, points, 5, CoordModePrevious); 1.33 } 1.34 } 1.35