summaryrefslogtreecommitdiffstats
path: root/bar.c
diff options
context:
space:
mode:
Diffstat (limited to 'bar.c')
-rw-r--r--bar.c16
1 files changed, 4 insertions, 12 deletions
diff --git a/bar.c b/bar.c
index ea4b946..611c669 100644
--- a/bar.c
+++ b/bar.c
@@ -25,30 +25,22 @@ draw_bar()
25 int i; 25 int i;
26 dc.x = dc.y = 0; 26 dc.x = dc.y = 0;
27 dc.w = bw; 27 dc.w = bw;
28 drawtext(NULL, False); 28 drawtext(NULL, False, False);
29 29
30 dc.w = 0; 30 dc.w = 0;
31 for(i = 0; i < TLast; i++) { 31 for(i = 0; i < TLast; i++) {
32 dc.x += dc.w; 32 dc.x += dc.w;
33 dc.w = textw(tags[i]) + dc.font.height; 33 dc.w = textw(tags[i]) + dc.font.height;
34 if(i == tsel) { 34 drawtext(tags[i], i == tsel, True);
35 swap((void **)&dc.fg, (void **)&dc.bg);
36 drawtext(tags[i], True);
37 swap((void **)&dc.fg, (void **)&dc.bg);
38 }
39 else
40 drawtext(tags[i], True);
41 } 35 }
42 if(sel) { 36 if(sel) {
43 swap((void **)&dc.fg, (void **)&dc.bg);
44 dc.x += dc.w; 37 dc.x += dc.w;
45 dc.w = textw(sel->name) + dc.font.height; 38 dc.w = textw(sel->name) + dc.font.height;
46 drawtext(sel->name, True); 39 drawtext(sel->name, True, True);
47 swap((void **)&dc.fg, (void **)&dc.bg);
48 } 40 }
49 dc.w = textw(stext) + dc.font.height; 41 dc.w = textw(stext) + dc.font.height;
50 dc.x = bx + bw - dc.w; 42 dc.x = bx + bw - dc.w;
51 drawtext(stext, False); 43 drawtext(stext, False, False);
52 XCopyArea(dpy, dc.drawable, barwin, dc.gc, 0, 0, bw, bh, 0, 0); 44 XCopyArea(dpy, dc.drawable, barwin, dc.gc, 0, 0, bw, bh, 0, 0);
53 XFlush(dpy); 45 XFlush(dpy);
54} 46}