dwm-meillo

diff draw.c @ 597:7a48d1f06223

improved tag indicator
author arg@mig29
date Fri, 01 Dec 2006 09:52:15 +0100
parents 601842ee4484
children 38bbcf31accc
line diff
     1.1 --- a/draw.c	Thu Nov 30 17:01:39 2006 +0100
     1.2 +++ b/draw.c	Fri Dec 01 09:52:15 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 ldot, Bool rdot) {
     1.8 +drawtext(const char *text, unsigned long col[ColLast], Bool border, Bool ldot) {
     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[5];
    1.15  
    1.16  	XSetForeground(dpy, dc.gc, col[ColBG]);
    1.17  	XFillRectangles(dpy, dc.drawable, dc.gc, &r, 1);
    1.18 @@ -79,11 +80,18 @@
    1.19  		r.width = r.height = (h + 2) / 4;
    1.20  		XFillRectangles(dpy, dc.drawable, dc.gc, &r, 1);
    1.21  	}
    1.22 -	if(rdot) {
    1.23 -		r.width = r.height = (h + 2) / 4;
    1.24 -		r.x = dc.x + dc.w - r.width - 2;
    1.25 -		r.y = dc.y + dc.h - r.height - 2;
    1.26 -		XFillRectangles(dpy, dc.drawable, dc.gc, &r, 1);
    1.27 +	if(border) {
    1.28 +		pt[0].x = dc.x;
    1.29 +		pt[0].y = dc.y;
    1.30 +		pt[1].x = dc.w - 1;
    1.31 +		pt[1].y = 0;
    1.32 +		pt[2].x = 0;
    1.33 +		pt[2].y = dc.h - 1;
    1.34 +		pt[3].x = -(dc.w - 1);
    1.35 +		pt[3].y = 0;
    1.36 +		pt[4].x = 0;
    1.37 +		pt[4].y = -(dc.h - 1);
    1.38 +		XDrawLines(dpy, dc.drawable, dc.gc, pt, 5, CoordModePrevious);
    1.39  	}
    1.40  }
    1.41