summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--draw.c35
1 files changed, 14 insertions, 21 deletions
diff --git a/draw.c b/draw.c
index 869c2f2..6466f41 100644
--- a/draw.c
+++ b/draw.c
@@ -9,26 +9,6 @@
9 9
10/* static */ 10/* static */
11 11
12static void
13drawborder(void)
14{
15 XPoint points[5];
16
17 XSetLineAttributes(dpy, dc.gc, 1, LineSolid, CapButt, JoinMiter);
18 XSetForeground(dpy, dc.gc, dc.border);
19 points[0].x = dc.x;
20 points[0].y = dc.y;
21 points[1].x = dc.w - 1;
22 points[1].y = 0;
23 points[2].x = 0;
24 points[2].y = dc.h - 1;
25 points[3].x = -(dc.w - 1);
26 points[3].y = 0;
27 points[4].x = 0;
28 points[4].y = -(dc.h - 1);
29 XDrawLines(dpy, dc.drawable, dc.gc, points, 5, CoordModePrevious);
30}
31
32static unsigned int 12static unsigned int
33textnw(const char *text, unsigned int len) 13textnw(const char *text, unsigned int len)
34{ 14{
@@ -48,11 +28,24 @@ drawtext(const char *text, Bool invert)
48 static char buf[256]; 28 static char buf[256];
49 unsigned int len; 29 unsigned int len;
50 XGCValues gcv; 30 XGCValues gcv;
31 XPoint points[5];
51 XRectangle r = { dc.x, dc.y, dc.w, dc.h }; 32 XRectangle r = { dc.x, dc.y, dc.w, dc.h };
52 33
53 XSetForeground(dpy, dc.gc, invert ? dc.fg : dc.bg); 34 XSetForeground(dpy, dc.gc, invert ? dc.fg : dc.bg);
54 XFillRectangles(dpy, dc.drawable, dc.gc, &r, 1); 35 XFillRectangles(dpy, dc.drawable, dc.gc, &r, 1);
55 drawborder(); 36 XSetLineAttributes(dpy, dc.gc, 1, LineSolid, CapButt, JoinMiter);
37 XSetForeground(dpy, dc.gc, dc.border);
38 points[0].x = dc.x;
39 points[0].y = dc.y;
40 points[1].x = dc.w - 1;
41 points[1].y = 0;
42 points[2].x = 0;
43 points[2].y = dc.h - 1;
44 points[3].x = -(dc.w - 1);
45 points[3].y = 0;
46 points[4].x = 0;
47 points[4].y = -(dc.h - 1);
48 XDrawLines(dpy, dc.drawable, dc.gc, points, 5, CoordModePrevious);
56 49
57 if(!text) 50 if(!text)
58 return; 51 return;