aewl

diff bar.c @ 31:386649deb651

before leaning things up
author Anselm R. Garbe <garbeam@wmii.de>
date Thu, 13 Jul 2006 01:04:38 +0200
parents e8f627998d6f
children
line diff
     1.1 --- a/bar.c	Wed Jul 12 17:50:31 2006 +0200
     1.2 +++ b/bar.c	Thu Jul 13 01:04:38 2006 +0200
     1.3 @@ -8,22 +8,34 @@
     1.4  void
     1.5  draw_bar()
     1.6  {
     1.7 +	int i;
     1.8  	brush.x = brush.y = 0;
     1.9  	brush.w = bw;
    1.10  	brush.h = bh;
    1.11  	draw(dpy, &brush, False, NULL);
    1.12  
    1.13 +	brush.w = 0;
    1.14 +	for(i = 0; i < TLast; i++) {
    1.15 +		brush.x += brush.w;
    1.16 +		brush.w = textw(&brush.font, tags[i]) + bh;
    1.17 +		if(i == tsel) {
    1.18 +			swap((void **)&brush.fg, (void **)&brush.bg);
    1.19 +			draw(dpy, &brush, True, tags[i]);
    1.20 +			swap((void **)&brush.fg, (void **)&brush.bg);
    1.21 +		}
    1.22 +		else
    1.23 +			draw(dpy, &brush, True, tags[i]);
    1.24 +	}
    1.25  	if(stack) {
    1.26 +		swap((void **)&brush.fg, (void **)&brush.bg);
    1.27 +		brush.x += brush.w;
    1.28  		brush.w = textw(&brush.font, stack->name) + bh;
    1.29 -		swap((void **)&brush.fg, (void **)&brush.bg);
    1.30  		draw(dpy, &brush, True, stack->name);
    1.31  		swap((void **)&brush.fg, (void **)&brush.bg);
    1.32 -		brush.x += brush.w;
    1.33  	}
    1.34 -
    1.35 -	brush.w = textw(&brush.font, statustext) + bh;
    1.36 +	brush.w = textw(&brush.font, stext) + bh;
    1.37  	brush.x = bx + bw - brush.w;
    1.38 -	draw(dpy, &brush, False, statustext);
    1.39 +	draw(dpy, &brush, False, stext);
    1.40  	XCopyArea(dpy, brush.drawable, barwin, brush.gc, 0, 0, bw, bh, 0, 0);
    1.41  	XFlush(dpy);
    1.42  }