garbeam@5: /* garbeam@5: * (C)opyright MMVI Anselm R. Garbe garbeam@5: * See LICENSE file for license details. garbeam@5: */ garbeam@5: garbeam@5: #include "wm.h" garbeam@5: garbeam@5: void garbeam@5: draw_bar() garbeam@5: { garbeam@31: int i; garbeam@26: brush.x = brush.y = 0; garbeam@26: brush.w = bw; garbeam@26: brush.h = bh; garbeam@16: draw(dpy, &brush, False, NULL); garbeam@16: garbeam@31: brush.w = 0; garbeam@31: for(i = 0; i < TLast; i++) { garbeam@31: brush.x += brush.w; garbeam@31: brush.w = textw(&brush.font, tags[i]) + bh; garbeam@31: if(i == tsel) { garbeam@31: swap((void **)&brush.fg, (void **)&brush.bg); garbeam@31: draw(dpy, &brush, True, tags[i]); garbeam@31: swap((void **)&brush.fg, (void **)&brush.bg); garbeam@31: } garbeam@31: else garbeam@31: draw(dpy, &brush, True, tags[i]); garbeam@31: } garbeam@16: if(stack) { garbeam@31: swap((void **)&brush.fg, (void **)&brush.bg); garbeam@31: brush.x += brush.w; garbeam@26: brush.w = textw(&brush.font, stack->name) + bh; garbeam@22: draw(dpy, &brush, True, stack->name); garbeam@16: swap((void **)&brush.fg, (void **)&brush.bg); garbeam@16: } garbeam@31: brush.w = textw(&brush.font, stext) + bh; garbeam@26: brush.x = bx + bw - brush.w; garbeam@31: draw(dpy, &brush, False, stext); garbeam@26: XCopyArea(dpy, brush.drawable, barwin, brush.gc, 0, 0, bw, bh, 0, 0); garbeam@5: XFlush(dpy); garbeam@5: }