comparison draw.c @ 607:16762f7414de

if client is focused, the emptysquare don't needs to be drawed
author arg@mig29
date Fri, 01 Dec 2006 17:51:05 +0100
parents 44b5617c78b3
children ecfc43176b2d
comparison
equal deleted inserted replaced
606:44b5617c78b3 607:16762f7414de
28 } 28 }
29 return XTextWidth(dc.font.xfont, text, len); 29 return XTextWidth(dc.font.xfont, text, len);
30 } 30 }
31 31
32 static void 32 static void
33 drawtext(const char *text, unsigned long col[ColLast], Bool filleddot, Bool emptydot) { 33 drawtext(const char *text, unsigned long col[ColLast], Bool filledsquare, Bool emptysquare) {
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 };
73 gcv.font = dc.font.xfont->fid; 73 gcv.font = dc.font.xfont->fid;
74 XChangeGC(dpy, dc.gc, GCForeground | GCFont, &gcv); 74 XChangeGC(dpy, dc.gc, GCForeground | GCFont, &gcv);
75 XDrawString(dpy, dc.drawable, dc.gc, x, y, buf, len); 75 XDrawString(dpy, dc.drawable, dc.gc, x, y, buf, len);
76 } 76 }
77 x = (h + 2) / 4; 77 x = (h + 2) / 4;
78 if(filleddot) { 78 if(filledsquare) {
79 r.x = dc.x + 2; 79 r.x = dc.x + 2;
80 r.y = dc.y + 2; 80 r.y = dc.y + 2;
81 r.width = r.height = x; 81 r.width = r.height = x;
82 XFillRectangles(dpy, dc.drawable, dc.gc, &r, 1); 82 XFillRectangles(dpy, dc.drawable, dc.gc, &r, 1);
83 } 83 }
84 if(emptydot) { 84 else if(emptysquare) {
85 pt[0].x = dc.x + 2; 85 pt[0].x = dc.x + 2;
86 pt[0].y = dc.y + 2; 86 pt[0].y = dc.y + 2;
87 pt[1].x = x; 87 pt[1].x = x;
88 pt[1].y = 0; 88 pt[1].y = 0;
89 pt[2].x = 0; 89 pt[2].x = 0;