JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
simplified several portions of code through replacing rect structs with x,y,h,w count...
[dwm.git] / bar.c
1 /*
2  * (C)opyright MMVI Anselm R. Garbe <garbeam at gmail dot com>
3  * See LICENSE file for license details.
4  */
5
6 #include "wm.h"
7
8 void
9 draw_bar()
10 {
11         brush.x = brush.y = 0;
12         brush.w = bw;
13         brush.h = bh;
14         draw(dpy, &brush, False, NULL);
15
16         if(stack) {
17                 brush.w = textw(&brush.font, stack->name) + bh;
18                 swap((void **)&brush.fg, (void **)&brush.bg);
19                 draw(dpy, &brush, True, stack->name);
20                 swap((void **)&brush.fg, (void **)&brush.bg);
21                 brush.x += brush.w;
22         }
23
24         brush.w = textw(&brush.font, statustext) + bh;
25         brush.x = bx + bw - brush.w;
26         draw(dpy, &brush, False, statustext);
27         XCopyArea(dpy, brush.drawable, barwin, brush.gc, 0, 0, bw, bh, 0, 0);
28         XFlush(dpy);
29 }