You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
811 B

  1. /*
  2. * (C)opyright MMVI Anselm R. Garbe <garbeam at gmail dot com>
  3. * See LICENSE file for license details.
  4. */
  5. #include "wm.h"
  6. void
  7. draw_bar()
  8. {
  9. brush.rect = barrect;
  10. brush.rect.x = brush.rect.y = 0;
  11. draw(dpy, &brush, False, NULL);
  12. if(stack) {
  13. brush.rect.width = textwidth(&brush.font, stack->name) + labelheight(&brush.font);
  14. swap((void **)&brush.fg, (void **)&brush.bg);
  15. draw(dpy, &brush, False, stack->name);
  16. swap((void **)&brush.fg, (void **)&brush.bg);
  17. brush.rect.x += brush.rect.width;
  18. }
  19. brush.rect.width = textwidth(&brush.font, statustext) + labelheight(&brush.font);
  20. brush.rect.x = barrect.x + barrect.width - brush.rect.width;
  21. draw(dpy, &brush, False, statustext);
  22. XCopyArea(dpy, brush.drawable, barwin, brush.gc, 0, 0, barrect.width,
  23. barrect.height, 0, 0);
  24. XFlush(dpy);
  25. }