diff options
| author | arg@mig29 <unknown> | 2006-12-01 09:52:15 +0100 |
|---|---|---|
| committer | arg@mig29 <unknown> | 2006-12-01 09:52:15 +0100 |
| commit | 0c9d9a3d949c0c0c3fb24417b54fca8182f54cb6 (patch) | |
| tree | 2503f85a0953b06f5e1fae958418a8a14544c91a | |
| parent | removed viewall signature from dwm.h (diff) | |
| download | dwm-0c9d9a3d949c0c0c3fb24417b54fca8182f54cb6.tar.gz dwm-0c9d9a3d949c0c0c3fb24417b54fca8182f54cb6.zip | |
improved tag indicator
Diffstat (limited to '')
| -rw-r--r-- | draw.c | 20 |
1 files changed, 14 insertions, 6 deletions
| @@ -30,12 +30,13 @@ textnw(const char *text, unsigned int len) { | |||
| 30 | } | 30 | } |
| 31 | 31 | ||
| 32 | static void | 32 | static void |
| 33 | drawtext(const char *text, unsigned long col[ColLast], Bool ldot, Bool rdot) { | 33 | drawtext(const char *text, unsigned long col[ColLast], Bool border, Bool ldot) { |
| 34 | int x, y, w, h; | 34 | int x, y, w, h; |
| 35 | static char buf[256]; | 35 | static char buf[256]; |
| 36 | unsigned int len, olen; | 36 | unsigned int len, olen; |
| 37 | XGCValues gcv; | 37 | XGCValues gcv; |
| 38 | XRectangle r = { dc.x, dc.y, dc.w, dc.h }; | 38 | XRectangle r = { dc.x, dc.y, dc.w, dc.h }; |
| 39 | XPoint pt[5]; | ||
| 39 | 40 | ||
| 40 | XSetForeground(dpy, dc.gc, col[ColBG]); | 41 | XSetForeground(dpy, dc.gc, col[ColBG]); |
| 41 | XFillRectangles(dpy, dc.drawable, dc.gc, &r, 1); | 42 | XFillRectangles(dpy, dc.drawable, dc.gc, &r, 1); |
| @@ -79,11 +80,18 @@ drawtext(const char *text, unsigned long col[ColLast], Bool ldot, Bool rdot) { | |||
| 79 | r.width = r.height = (h + 2) / 4; | 80 | r.width = r.height = (h + 2) / 4; |
| 80 | XFillRectangles(dpy, dc.drawable, dc.gc, &r, 1); | 81 | XFillRectangles(dpy, dc.drawable, dc.gc, &r, 1); |
| 81 | } | 82 | } |
| 82 | if(rdot) { | 83 | if(border) { |
| 83 | r.width = r.height = (h + 2) / 4; | 84 | pt[0].x = dc.x; |
| 84 | r.x = dc.x + dc.w - r.width - 2; | 85 | pt[0].y = dc.y; |
| 85 | r.y = dc.y + dc.h - r.height - 2; | 86 | pt[1].x = dc.w - 1; |
| 86 | XFillRectangles(dpy, dc.drawable, dc.gc, &r, 1); | 87 | pt[1].y = 0; |
| 88 | pt[2].x = 0; | ||
| 89 | pt[2].y = dc.h - 1; | ||
| 90 | pt[3].x = -(dc.w - 1); | ||
| 91 | pt[3].y = 0; | ||
| 92 | pt[4].x = 0; | ||
| 93 | pt[4].y = -(dc.h - 1); | ||
| 94 | XDrawLines(dpy, dc.drawable, dc.gc, pt, 5, CoordModePrevious); | ||
| 87 | } | 95 | } |
| 88 | } | 96 | } |
| 89 | 97 | ||
