summaryrefslogtreecommitdiffstats
path: root/bar.c
diff options
context:
space:
mode:
authorAnselm R. Garbe <garbeam@wmii.de>2006-07-13 01:04:38 +0200
committerAnselm R. Garbe <garbeam@wmii.de>2006-07-13 01:04:38 +0200
commitda2bbd371c522d63d737d43a127601a3fdbcb9d8 (patch)
treefe7f5874dc09c446d3da38f15930c5f6ae523c13 /bar.c
parentnew stuff, fixed several issues (diff)
downloaddwm-da2bbd371c522d63d737d43a127601a3fdbcb9d8.tar.gz
dwm-da2bbd371c522d63d737d43a127601a3fdbcb9d8.zip
before leaning things up
Diffstat (limited to '')
-rw-r--r--bar.c22
1 files changed, 17 insertions, 5 deletions
diff --git a/bar.c b/bar.c
index f70a246..d9d8171 100644
--- a/bar.c
+++ b/bar.c
@@ -8,22 +8,34 @@
8void 8void
9draw_bar() 9draw_bar()
10{ 10{
11 int i;
11 brush.x = brush.y = 0; 12 brush.x = brush.y = 0;
12 brush.w = bw; 13 brush.w = bw;
13 brush.h = bh; 14 brush.h = bh;
14 draw(dpy, &brush, False, NULL); 15 draw(dpy, &brush, False, NULL);
15 16
17 brush.w = 0;
18 for(i = 0; i < TLast; i++) {
19 brush.x += brush.w;
20 brush.w = textw(&brush.font, tags[i]) + bh;
21 if(i == tsel) {
22 swap((void **)&brush.fg, (void **)&brush.bg);
23 draw(dpy, &brush, True, tags[i]);
24 swap((void **)&brush.fg, (void **)&brush.bg);
25 }
26 else
27 draw(dpy, &brush, True, tags[i]);
28 }
16 if(stack) { 29 if(stack) {
17 brush.w = textw(&brush.font, stack->name) + bh;
18 swap((void **)&brush.fg, (void **)&brush.bg); 30 swap((void **)&brush.fg, (void **)&brush.bg);
31 brush.x += brush.w;
32 brush.w = textw(&brush.font, stack->name) + bh;
19 draw(dpy, &brush, True, stack->name); 33 draw(dpy, &brush, True, stack->name);
20 swap((void **)&brush.fg, (void **)&brush.bg); 34 swap((void **)&brush.fg, (void **)&brush.bg);
21 brush.x += brush.w;
22 } 35 }
23 36 brush.w = textw(&brush.font, stext) + bh;
24 brush.w = textw(&brush.font, statustext) + bh;
25 brush.x = bx + bw - brush.w; 37 brush.x = bx + bw - brush.w;
26 draw(dpy, &brush, False, statustext); 38 draw(dpy, &brush, False, stext);
27 XCopyArea(dpy, brush.drawable, barwin, brush.gc, 0, 0, bw, bh, 0, 0); 39 XCopyArea(dpy, brush.drawable, barwin, brush.gc, 0, 0, bw, bh, 0, 0);
28 XFlush(dpy); 40 XFlush(dpy);
29} 41}