aewl

annotate bar.c @ 19:b5510d0c6d43

added basic mouse support (actually we don't need more)
author Anselm R. Garbe <garbeam@wmii.de>
date Tue, 11 Jul 2006 21:41:49 +0200
parents 5c078b66347b
children bd3a44353916
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@5 11 brush.rect = barrect;
garbeam@5 12 brush.rect.x = brush.rect.y = 0;
garbeam@16 13 draw(dpy, &brush, False, NULL);
garbeam@16 14
garbeam@16 15 if(stack) {
garbeam@16 16 brush.rect.width = textwidth(&brush.font, stack->name) + labelheight(&brush.font);
garbeam@16 17 swap((void **)&brush.fg, (void **)&brush.bg);
garbeam@16 18 draw(dpy, &brush, False, stack->name);
garbeam@16 19 swap((void **)&brush.fg, (void **)&brush.bg);
garbeam@16 20 brush.rect.x += brush.rect.width;
garbeam@16 21 }
garbeam@16 22
garbeam@16 23 brush.rect.width = textwidth(&brush.font, statustext) + labelheight(&brush.font);
garbeam@16 24 brush.rect.x = barrect.x + barrect.width - brush.rect.width;
garbeam@16 25 draw(dpy, &brush, False, statustext);
garbeam@5 26
garbeam@5 27 XCopyArea(dpy, brush.drawable, barwin, brush.gc, 0, 0, barrect.width,
garbeam@5 28 barrect.height, 0, 0);
garbeam@5 29 XFlush(dpy);
garbeam@5 30 }