aewl

annotate 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
rev   line source
garbeam@5 1 /*
garbeam@5 2 * (C)opyright MMVI Anselm R. Garbe <garbeam at gmail dot com>
garbeam@5 3 * See LICENSE file for license details.
garbeam@5 4 */
garbeam@5 5
garbeam@5 6 #include "wm.h"
garbeam@5 7
garbeam@5 8 void
garbeam@5 9 draw_bar()
garbeam@5 10 {
garbeam@26 11 brush.x = brush.y = 0;
garbeam@26 12 brush.w = bw;
garbeam@26 13 brush.h = bh;
garbeam@16 14 draw(dpy, &brush, False, NULL);
garbeam@16 15
garbeam@16 16 if(stack) {
garbeam@26 17 brush.w = textw(&brush.font, stack->name) + bh;
garbeam@16 18 swap((void **)&brush.fg, (void **)&brush.bg);
garbeam@22 19 draw(dpy, &brush, True, stack->name);
garbeam@16 20 swap((void **)&brush.fg, (void **)&brush.bg);
garbeam@26 21 brush.x += brush.w;
garbeam@16 22 }
garbeam@16 23
garbeam@26 24 brush.w = textw(&brush.font, statustext) + bh;
garbeam@26 25 brush.x = bx + bw - brush.w;
garbeam@16 26 draw(dpy, &brush, False, statustext);
garbeam@26 27 XCopyArea(dpy, brush.drawable, barwin, brush.gc, 0, 0, bw, bh, 0, 0);
garbeam@5 28 XFlush(dpy);
garbeam@5 29 }