drawing border with fg color
4b0328f2
1 file(s) · +14 −1
| 28 | 28 | static char buf[256]; |
|
| 29 | 29 | unsigned int len; |
|
| 30 | 30 | XGCValues gcv; |
|
| 31 | + | XPoint points[5]; |
|
| 31 | 32 | XRectangle r = { dc.x, dc.y, dc.w, dc.h }; |
|
| 32 | 33 | ||
| 33 | 34 | XSetForeground(dpy, dc.gc, invert ? dc.fg : dc.bg); |
|
| 34 | 35 | XFillRectangles(dpy, dc.drawable, dc.gc, &r, 1); |
|
| 35 | - | ||
| 36 | 36 | if(!text) |
|
| 37 | 37 | return; |
|
| 38 | 38 | ||
| 66 | 66 | XChangeGC(dpy, dc.gc, GCForeground | GCBackground | GCFont, &gcv); |
|
| 67 | 67 | XDrawImageString(dpy, dc.drawable, dc.gc, x, y, buf, len); |
|
| 68 | 68 | } |
|
| 69 | + | ||
| 70 | + | XSetLineAttributes(dpy, dc.gc, 1, LineSolid, CapButt, JoinMiter); |
|
| 71 | + | points[0].x = dc.x; |
|
| 72 | + | points[0].y = dc.y; |
|
| 73 | + | points[1].x = dc.w - 1; |
|
| 74 | + | points[1].y = 0; |
|
| 75 | + | points[2].x = 0; |
|
| 76 | + | points[2].y = dc.h - 1; |
|
| 77 | + | points[3].x = -(dc.w - 1); |
|
| 78 | + | points[3].y = 0; |
|
| 79 | + | points[4].x = 0; |
|
| 80 | + | points[4].y = -(dc.h - 1); |
|
| 81 | + | XDrawLines(dpy, dc.drawable, dc.gc, points, 5, CoordModePrevious); |
|
| 69 | 82 | } |
|
| 70 | 83 | ||
| 71 | 84 | /* extern */ |
|