improved tag indicator
0c9d9a3d
1 file(s) · +14 −6
| 30 | 30 | } |
|
| 31 | 31 | ||
| 32 | 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 | 34 | int x, y, w, h; |
|
| 35 | 35 | static char buf[256]; |
|
| 36 | 36 | unsigned int len, olen; |
|
| 37 | 37 | XGCValues gcv; |
|
| 38 | 38 | XRectangle r = { dc.x, dc.y, dc.w, dc.h }; |
|
| 39 | + | XPoint pt[5]; |
|
| 39 | 40 | ||
| 40 | 41 | XSetForeground(dpy, dc.gc, col[ColBG]); |
|
| 41 | 42 | XFillRectangles(dpy, dc.drawable, dc.gc, &r, 1); |
|
| 79 | 80 | r.width = r.height = (h + 2) / 4; |
|
| 80 | 81 | XFillRectangles(dpy, dc.drawable, dc.gc, &r, 1); |
|
| 81 | 82 | } |
|
| 82 | - | if(rdot) { |
|
| 83 | - | r.width = r.height = (h + 2) / 4; |
|
| 84 | - | r.x = dc.x + dc.w - r.width - 2; |
|
| 85 | - | r.y = dc.y + dc.h - r.height - 2; |
|
| 86 | - | XFillRectangles(dpy, dc.drawable, dc.gc, &r, 1); |
|
| 83 | + | if(border) { |
|
| 84 | + | pt[0].x = dc.x; |
|
| 85 | + | pt[0].y = dc.y; |
|
| 86 | + | pt[1].x = dc.w - 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 | ||