aewl

changeset 218:c674a0baac63

changed signature of drawtext
author arg@10ksloc.org
date Mon, 07 Aug 2006 13:54:59 +0200
parents 7b63c375d28c
children d8e508716aa8
files draw.c
diffstat 1 files changed, 10 insertions(+), 12 deletions(-) [+]
line diff
     1.1 --- a/draw.c	Mon Aug 07 13:40:31 2006 +0200
     1.2 +++ b/draw.c	Mon Aug 07 13:54:59 2006 +0200
     1.3 @@ -42,7 +42,7 @@
     1.4  }
     1.5  
     1.6  static void
     1.7 -drawtext(const char *text, Bool invert, Bool border)
     1.8 +drawtext(const char *text, Bool invert)
     1.9  {
    1.10  	int x, y, w, h;
    1.11  	static char buf[256];
    1.12 @@ -52,14 +52,12 @@
    1.13  
    1.14  	XSetForeground(dpy, dc.gc, invert ? dc.fg : dc.bg);
    1.15  	XFillRectangles(dpy, dc.drawable, dc.gc, &r, 1);
    1.16 -
    1.17 -	w = 0;
    1.18 -	if(border)
    1.19 -		drawborder();
    1.20 +	drawborder();
    1.21  
    1.22  	if(!text)
    1.23  		return;
    1.24  
    1.25 +	w = 0;
    1.26  	len = strlen(text);
    1.27  	if(len >= sizeof(buf))
    1.28  		len = sizeof(buf) - 1;
    1.29 @@ -111,24 +109,24 @@
    1.30  
    1.31  	dc.x = dc.y = 0;
    1.32  	dc.w = bw;
    1.33 -	drawtext(NULL, !istile, False);
    1.34 +	drawtext(NULL, !istile);
    1.35  
    1.36  	dc.w = 0;
    1.37  	for(i = 0; i < ntags; i++) {
    1.38  		dc.x += dc.w;
    1.39  		dc.w = textw(tags[i]);
    1.40  		if(istile)
    1.41 -			drawtext(tags[i], (i == tsel), True);
    1.42 +			drawtext(tags[i], (i == tsel));
    1.43  		else
    1.44 -			drawtext(tags[i], (i != tsel), True);
    1.45 +			drawtext(tags[i], (i != tsel));
    1.46  	}
    1.47  	x = dc.x + dc.w;
    1.48  	dc.w = textw(stext);
    1.49  	dc.x = bx + bw - dc.w;
    1.50 -	drawtext(stext, !istile, True);
    1.51 +	drawtext(stext, !istile);
    1.52  	if(sel && ((dc.w = dc.x - x) >= bh)) {
    1.53  		dc.x = x;
    1.54 -		drawtext(sel->name, istile, True);
    1.55 +		drawtext(sel->name, istile);
    1.56  	}
    1.57  	XCopyArea(dpy, dc.drawable, barwin, dc.gc, 0, 0, bw, bh, 0, 0);
    1.58  	XSync(dpy, False);
    1.59 @@ -157,12 +155,12 @@
    1.60  		if(c->tags[i]) {
    1.61  			dc.x += dc.w;
    1.62  			dc.w = textw(tags[i]);
    1.63 -			drawtext(tags[i], !istile, True);
    1.64 +			drawtext(tags[i], !istile);
    1.65  		}
    1.66  	}
    1.67  	dc.x += dc.w;
    1.68  	dc.w = textw(c->name);
    1.69 -	drawtext(c->name, !istile, True);
    1.70 +	drawtext(c->name, !istile);
    1.71  	XCopyArea(dpy, dc.drawable, c->title, dc.gc, 0, 0, c->tw, c->th, 0, 0);
    1.72  	XSync(dpy, False);
    1.73  }