aewl

view bar.c @ 22:bd3a44353916

fixed several other stuff, coming closer to something useful
author Anselm R. Garbe <garbeam@wmii.de>
date Tue, 11 Jul 2006 23:46:39 +0200
parents 359b6e563b95
children e8f627998d6f
line source
1 /*
2 * (C)opyright MMVI Anselm R. Garbe <garbeam at gmail dot com>
3 * See LICENSE file for license details.
4 */
6 #include "wm.h"
8 void
9 draw_bar()
10 {
11 brush.rect = barrect;
12 brush.rect.x = brush.rect.y = 0;
13 draw(dpy, &brush, False, NULL);
15 if(stack) {
16 brush.rect.width = textwidth(&brush.font, stack->name) + labelheight(&brush.font);
17 swap((void **)&brush.fg, (void **)&brush.bg);
18 draw(dpy, &brush, True, stack->name);
19 swap((void **)&brush.fg, (void **)&brush.bg);
20 brush.rect.x += brush.rect.width;
21 }
23 brush.rect.width = textwidth(&brush.font, statustext) + labelheight(&brush.font);
24 brush.rect.x = barrect.x + barrect.width - brush.rect.width;
25 draw(dpy, &brush, False, statustext);
27 XCopyArea(dpy, brush.drawable, barwin, brush.gc, 0, 0, barrect.width,
28 barrect.height, 0, 0);
29 XFlush(dpy);
30 }