2006-07-10 21:16:48 +01:00
|
|
|
/*
|
|
|
|
* (C)opyright MMVI Anselm R. Garbe <garbeam at gmail dot com>
|
|
|
|
* See LICENSE file for license details.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "wm.h"
|
|
|
|
|
|
|
|
void
|
|
|
|
draw_bar()
|
|
|
|
{
|
2006-07-13 00:04:38 +01:00
|
|
|
int i;
|
2006-07-12 14:17:22 +01:00
|
|
|
brush.x = brush.y = 0;
|
|
|
|
brush.w = bw;
|
|
|
|
brush.h = bh;
|
2006-07-11 17:53:41 +01:00
|
|
|
draw(dpy, &brush, False, NULL);
|
|
|
|
|
2006-07-13 00:04:38 +01:00
|
|
|
brush.w = 0;
|
|
|
|
for(i = 0; i < TLast; i++) {
|
|
|
|
brush.x += brush.w;
|
|
|
|
brush.w = textw(&brush.font, tags[i]) + bh;
|
|
|
|
if(i == tsel) {
|
|
|
|
swap((void **)&brush.fg, (void **)&brush.bg);
|
|
|
|
draw(dpy, &brush, True, tags[i]);
|
|
|
|
swap((void **)&brush.fg, (void **)&brush.bg);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
draw(dpy, &brush, True, tags[i]);
|
|
|
|
}
|
2006-07-11 17:53:41 +01:00
|
|
|
if(stack) {
|
|
|
|
swap((void **)&brush.fg, (void **)&brush.bg);
|
2006-07-13 00:04:38 +01:00
|
|
|
brush.x += brush.w;
|
|
|
|
brush.w = textw(&brush.font, stack->name) + bh;
|
2006-07-11 22:46:39 +01:00
|
|
|
draw(dpy, &brush, True, stack->name);
|
2006-07-11 17:53:41 +01:00
|
|
|
swap((void **)&brush.fg, (void **)&brush.bg);
|
|
|
|
}
|
2006-07-13 00:04:38 +01:00
|
|
|
brush.w = textw(&brush.font, stext) + bh;
|
2006-07-12 14:17:22 +01:00
|
|
|
brush.x = bx + bw - brush.w;
|
2006-07-13 00:04:38 +01:00
|
|
|
draw(dpy, &brush, False, stext);
|
2006-07-12 14:17:22 +01:00
|
|
|
XCopyArea(dpy, brush.drawable, barwin, brush.gc, 0, 0, bw, bh, 0, 0);
|
2006-07-10 21:16:48 +01:00
|
|
|
XFlush(dpy);
|
|
|
|
}
|