aewl

view bar.c @ 26:e8f627998d6f

simplified several portions of code through replacing rect structs with x,y,h,w counterparts (much more readable)
author Anselm R. Garbe <garbeam@wmii.de>
date Wed, 12 Jul 2006 15:17:22 +0200
parents bd3a44353916
children 386649deb651
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.x = brush.y = 0;
12 brush.w = bw;
13 brush.h = bh;
14 draw(dpy, &brush, False, NULL);
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 }
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 }