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@5: brush.rect = barrect; garbeam@5: brush.rect.x = brush.rect.y = 0; garbeam@16: draw(dpy, &brush, False, NULL); garbeam@16: garbeam@16: if(stack) { garbeam@16: brush.rect.width = textwidth(&brush.font, stack->name) + labelheight(&brush.font); garbeam@16: swap((void **)&brush.fg, (void **)&brush.bg); garbeam@16: draw(dpy, &brush, False, stack->name); garbeam@16: swap((void **)&brush.fg, (void **)&brush.bg); garbeam@16: brush.rect.x += brush.rect.width; garbeam@16: } garbeam@16: garbeam@16: brush.rect.width = textwidth(&brush.font, statustext) + labelheight(&brush.font); garbeam@16: brush.rect.x = barrect.x + barrect.width - brush.rect.width; garbeam@16: draw(dpy, &brush, False, statustext); garbeam@5: garbeam@5: XCopyArea(dpy, brush.drawable, barwin, brush.gc, 0, 0, barrect.width, garbeam@5: barrect.height, 0, 0); garbeam@5: XFlush(dpy); garbeam@5: }