comparison bar.c @ 72:d0eb0bb63c40

I prefer the tiled/floating indicator on the right side
author Anselm R. Garbe <garbeam@wmii.de>
date Fri, 14 Jul 2006 18:59:25 +0200
parents 7681ef838201
children
comparison
equal deleted inserted replaced
71:7681ef838201 72:d0eb0bb63c40
20 } 20 }
21 21
22 void 22 void
23 draw_bar() 23 draw_bar()
24 { 24 {
25 int i; 25 int i, modw;
26 char *mode = arrange == tiling ? "#" : "~"; 26 char *mode = arrange == tiling ? "#" : "~";
27 27
28 dc.x = dc.y = 0; 28 dc.x = dc.y = 0;
29 dc.w = bw; 29 dc.w = bw;
30 drawtext(NULL, False, False); 30 drawtext(NULL, False, False);
31 31
32 dc.w = textw(mode) + dc.font.height; 32 modw = textw(mode) + dc.font.height;
33 drawtext(mode, True, True); 33 dc.w = 0;
34
35 for(i = 0; i < TLast; i++) { 34 for(i = 0; i < TLast; i++) {
36 dc.x += dc.w; 35 dc.x += dc.w;
37 dc.w = textw(tags[i]) + dc.font.height; 36 dc.w = textw(tags[i]) + dc.font.height;
38 drawtext(tags[i], i == tsel, True); 37 drawtext(tags[i], i == tsel, True);
39 } 38 }
41 dc.x += dc.w; 40 dc.x += dc.w;
42 dc.w = textw(sel->name) + dc.font.height; 41 dc.w = textw(sel->name) + dc.font.height;
43 drawtext(sel->name, True, True); 42 drawtext(sel->name, True, True);
44 } 43 }
45 dc.w = textw(stext) + dc.font.height; 44 dc.w = textw(stext) + dc.font.height;
46 dc.x = bx + bw - dc.w; 45 dc.x = bx + bw - dc.w - modw;
47 drawtext(stext, False, False); 46 drawtext(stext, False, False);
47
48 dc.x = bx + bw - modw;
49 dc.w = modw;
50 drawtext(mode, True, True);
51
48 XCopyArea(dpy, dc.drawable, barwin, dc.gc, 0, 0, bw, bh, 0, 0); 52 XCopyArea(dpy, dc.drawable, barwin, dc.gc, 0, 0, bw, bh, 0, 0);
49 XFlush(dpy); 53 XFlush(dpy);
50 } 54 }