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 | changing tag indicator through underline (diff) | |
| download | dwm-c976bc6c2cbc2f197806259b58a6c6ff2d154284.tar.gz 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) | |||
| 22 | } | 22 | } |
| 23 | 23 | ||
| 24 | static void | 24 | static void |
| 25 | drawtext(const char *text, Bool invert, Bool underline) | 25 | drawtext(const char *text, Bool invert, Bool highlight) |
| 26 | { | 26 | { |
| 27 | int x, y, w, h; | 27 | int x, y, w, h; |
| 28 | static char buf[256]; | 28 | static char buf[256]; |
| @@ -85,12 +85,18 @@ drawtext(const char *text, Bool invert, Bool underline) | |||
| 85 | XChangeGC(dpy, dc.gc, GCForeground | GCBackground | GCFont, &gcv); | 85 | XChangeGC(dpy, dc.gc, GCForeground | GCBackground | GCFont, &gcv); |
| 86 | XDrawString(dpy, dc.drawable, dc.gc, x, y, buf, len); | 86 | XDrawString(dpy, dc.drawable, dc.gc, x, y, buf, len); |
| 87 | } | 87 | } |
| 88 | if(underline) { | 88 | if(highlight) { |
| 89 | points[0].x = dc.x + (h / 2) - 1; | 89 | points[0].x = dc.x + 1; |
| 90 | points[0].y = dc.y + dc.h - 3; | 90 | points[0].y = dc.y + 1; |
| 91 | points[1].x = dc.w - h + 2; | 91 | points[1].x = dc.w - 3; |
| 92 | points[1].y = 0; | 92 | points[1].y = 0; |
| 93 | XDrawLines(dpy, dc.drawable, dc.gc, points, 2, CoordModePrevious); | 93 | points[2].x = 0; |
| 94 | points[2].y = dc.h - 3; | ||
| 95 | points[3].x = -(dc.w - 3); | ||
| 96 | points[3].y = 0; | ||
| 97 | points[4].x = 0; | ||
| 98 | points[4].y = -(dc.h - 3); | ||
| 99 | XDrawLines(dpy, dc.drawable, dc.gc, points, 5, CoordModePrevious); | ||
| 94 | } | 100 | } |
| 95 | } | 101 | } |
| 96 | 102 | ||
