aewl

diff draw.c @ 606:44b5617c78b3

and the winner is
author arg@mig29
date Fri, 01 Dec 2006 17:45:27 +0100
parents 755d8dcb8a05
children 16762f7414de
line diff
     1.1 --- a/draw.c	Fri Dec 01 17:36:37 2006 +0100
     1.2 +++ b/draw.c	Fri Dec 01 17:45:27 2006 +0100
     1.3 @@ -30,13 +30,13 @@
     1.4  }
     1.5  
     1.6  static void
     1.7 -drawtext(const char *text, unsigned long col[ColLast], Bool dot, Bool corner) {
     1.8 +drawtext(const char *text, unsigned long col[ColLast], Bool filleddot, Bool emptydot) {
     1.9  	int x, y, w, h;
    1.10  	static char buf[256];
    1.11  	unsigned int len, olen;
    1.12  	XGCValues gcv;
    1.13  	XRectangle r = { dc.x, dc.y, dc.w, dc.h };
    1.14 -	XPoint pt[3];
    1.15 +	XPoint pt[5];
    1.16  
    1.17  	XSetForeground(dpy, dc.gc, col[ColBG]);
    1.18  	XFillRectangles(dpy, dc.drawable, dc.gc, &r, 1);
    1.19 @@ -74,20 +74,25 @@
    1.20  		XChangeGC(dpy, dc.gc, GCForeground | GCFont, &gcv);
    1.21  		XDrawString(dpy, dc.drawable, dc.gc, x, y, buf, len);
    1.22  	}
    1.23 -	if(dot) {
    1.24 +	x = (h + 2) / 4;
    1.25 +	if(filleddot) {
    1.26  		r.x = dc.x + 2;
    1.27  		r.y = dc.y + 2;
    1.28 -		r.width = r.height = (h + 2) / 4;
    1.29 +		r.width = r.height = x;
    1.30  		XFillRectangles(dpy, dc.drawable, dc.gc, &r, 1);
    1.31  	}
    1.32 -	if(corner) {
    1.33 -		pt[0].x = dc.x + 1;
    1.34 -		pt[0].y = dc.y + dc.h / 2 + 1;
    1.35 -		pt[1].x = 0;
    1.36 -		pt[1].y = - dc.h / 2;
    1.37 -		pt[2].x = dc.h / 2;
    1.38 -		pt[2].y = 0;
    1.39 -		XDrawLines(dpy, dc.drawable, dc.gc, pt, 3, CoordModePrevious);
    1.40 +	if(emptydot) {
    1.41 +		pt[0].x = dc.x + 2;
    1.42 +		pt[0].y = dc.y + 2;
    1.43 +		pt[1].x = x;
    1.44 +		pt[1].y = 0;
    1.45 +		pt[2].x = 0;
    1.46 +		pt[2].y = x;
    1.47 +		pt[3].x = -x;
    1.48 +		pt[3].y = 0;
    1.49 +		pt[4].x = 0;
    1.50 +		pt[4].y = -x;
    1.51 +		XDrawLines(dpy, dc.drawable, dc.gc, pt, 5, CoordModePrevious);
    1.52  	}
    1.53  }
    1.54