aewl
view 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 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 int i;
12 brush.x = brush.y = 0;
13 brush.w = bw;
14 brush.h = bh;
15 draw(dpy, &brush, False, NULL);
17 brush.w = 0;
18 for(i = 0; i < TLast; i++) {
19 brush.x += brush.w;
20 brush.w = textw(&brush.font, tags[i]) + bh;
21 if(i == tsel) {
22 swap((void **)&brush.fg, (void **)&brush.bg);
23 draw(dpy, &brush, True, tags[i]);
24 swap((void **)&brush.fg, (void **)&brush.bg);
25 }
26 else
27 draw(dpy, &brush, True, tags[i]);
28 }
29 if(stack) {
30 swap((void **)&brush.fg, (void **)&brush.bg);
31 brush.x += brush.w;
32 brush.w = textw(&brush.font, stack->name) + bh;
33 draw(dpy, &brush, True, stack->name);
34 swap((void **)&brush.fg, (void **)&brush.bg);
35 }
36 brush.w = textw(&brush.font, stext) + bh;
37 brush.x = bx + bw - brush.w;
38 draw(dpy, &brush, False, stext);
39 XCopyArea(dpy, brush.drawable, barwin, brush.gc, 0, 0, bw, bh, 0, 0);
40 XFlush(dpy);
41 }