dwm-meillo

diff draw.c @ 605:755d8dcb8a05

sander1 proposal
author arg@mig29
date Fri, 01 Dec 2006 17:36:37 +0100
parents 2c366b252717
children 44b5617c78b3
line diff
     1.1 --- a/draw.c	Fri Dec 01 16:55:42 2006 +0100
     1.2 +++ b/draw.c	Fri Dec 01 17:36:37 2006 +0100
     1.3 @@ -30,12 +30,13 @@
     1.4  }
     1.5  
     1.6  static void
     1.7 -drawtext(const char *text, unsigned long col[ColLast], Bool hborder, Bool vborder) {
     1.8 +drawtext(const char *text, unsigned long col[ColLast], Bool dot, Bool corner) {
     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  
    1.16  	XSetForeground(dpy, dc.gc, col[ColBG]);
    1.17  	XFillRectangles(dpy, dc.drawable, dc.gc, &r, 1);
    1.18 @@ -73,13 +74,20 @@
    1.19  		XChangeGC(dpy, dc.gc, GCForeground | GCFont, &gcv);
    1.20  		XDrawString(dpy, dc.drawable, dc.gc, x, y, buf, len);
    1.21  	}
    1.22 -	if(vborder) {
    1.23 -		XDrawLine(dpy, dc.drawable, dc.gc, dc.x + 1, dc.y + 1, dc.x + 1, dc.y + dc.h - 1);
    1.24 -		XDrawLine(dpy, dc.drawable, dc.gc, dc.x + dc.w - 2, dc.y + 1, dc.x + dc.w - 2, dc.y + dc.h - 1);
    1.25 +	if(dot) {
    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 +		XFillRectangles(dpy, dc.drawable, dc.gc, &r, 1);
    1.30  	}
    1.31 -	if(hborder) {
    1.32 -		XDrawLine(dpy, dc.drawable, dc.gc, dc.x + 1, dc.y + 1, dc.x + dc.w - 2, dc.y + 1);
    1.33 -		XDrawLine(dpy, dc.drawable, dc.gc, dc.x + 1, dc.y + dc.h - 2, dc.x + dc.w - 2, dc.y + dc.h - 2);
    1.34 +	if(corner) {
    1.35 +		pt[0].x = dc.x + 1;
    1.36 +		pt[0].y = dc.y + dc.h / 2 + 1;
    1.37 +		pt[1].x = 0;
    1.38 +		pt[1].y = - dc.h / 2;
    1.39 +		pt[2].x = dc.h / 2;
    1.40 +		pt[2].y = 0;
    1.41 +		XDrawLines(dpy, dc.drawable, dc.gc, pt, 3, CoordModePrevious);
    1.42  	}
    1.43  }
    1.44