changed signature of drawtext
4250c26e
1 file(s) · +10 −12
| 42 | 42 | } |
|
| 43 | 43 | ||
| 44 | 44 | static void |
|
| 45 | - | drawtext(const char *text, Bool invert, Bool border) |
|
| 45 | + | drawtext(const char *text, Bool invert) |
|
| 46 | 46 | { |
|
| 47 | 47 | int x, y, w, h; |
|
| 48 | 48 | static char buf[256]; |
|
| 52 | 52 | ||
| 53 | 53 | XSetForeground(dpy, dc.gc, invert ? dc.fg : dc.bg); |
|
| 54 | 54 | XFillRectangles(dpy, dc.drawable, dc.gc, &r, 1); |
|
| 55 | - | ||
| 56 | - | w = 0; |
|
| 57 | - | if(border) |
|
| 58 | - | drawborder(); |
|
| 55 | + | drawborder(); |
|
| 59 | 56 | ||
| 60 | 57 | if(!text) |
|
| 61 | 58 | return; |
|
| 62 | 59 | ||
| 60 | + | w = 0; |
|
| 63 | 61 | len = strlen(text); |
|
| 64 | 62 | if(len >= sizeof(buf)) |
|
| 65 | 63 | len = sizeof(buf) - 1; |
|
| 111 | 109 | ||
| 112 | 110 | dc.x = dc.y = 0; |
|
| 113 | 111 | dc.w = bw; |
|
| 114 | - | drawtext(NULL, !istile, False); |
|
| 112 | + | drawtext(NULL, !istile); |
|
| 115 | 113 | ||
| 116 | 114 | dc.w = 0; |
|
| 117 | 115 | for(i = 0; i < ntags; i++) { |
|
| 118 | 116 | dc.x += dc.w; |
|
| 119 | 117 | dc.w = textw(tags[i]); |
|
| 120 | 118 | if(istile) |
|
| 121 | - | drawtext(tags[i], (i == tsel), True); |
|
| 119 | + | drawtext(tags[i], (i == tsel)); |
|
| 122 | 120 | else |
|
| 123 | - | drawtext(tags[i], (i != tsel), True); |
|
| 121 | + | drawtext(tags[i], (i != tsel)); |
|
| 124 | 122 | } |
|
| 125 | 123 | x = dc.x + dc.w; |
|
| 126 | 124 | dc.w = textw(stext); |
|
| 127 | 125 | dc.x = bx + bw - dc.w; |
|
| 128 | - | drawtext(stext, !istile, True); |
|
| 126 | + | drawtext(stext, !istile); |
|
| 129 | 127 | if(sel && ((dc.w = dc.x - x) >= bh)) { |
|
| 130 | 128 | dc.x = x; |
|
| 131 | - | drawtext(sel->name, istile, True); |
|
| 129 | + | drawtext(sel->name, istile); |
|
| 132 | 130 | } |
|
| 133 | 131 | XCopyArea(dpy, dc.drawable, barwin, dc.gc, 0, 0, bw, bh, 0, 0); |
|
| 134 | 132 | XSync(dpy, False); |
|
| 157 | 155 | if(c->tags[i]) { |
|
| 158 | 156 | dc.x += dc.w; |
|
| 159 | 157 | dc.w = textw(tags[i]); |
|
| 160 | - | drawtext(tags[i], !istile, True); |
|
| 158 | + | drawtext(tags[i], !istile); |
|
| 161 | 159 | } |
|
| 162 | 160 | } |
|
| 163 | 161 | dc.x += dc.w; |
|
| 164 | 162 | dc.w = textw(c->name); |
|
| 165 | - | drawtext(c->name, !istile, True); |
|
| 163 | + | drawtext(c->name, !istile); |
|
| 166 | 164 | XCopyArea(dpy, dc.drawable, c->title, dc.gc, 0, 0, c->tw, c->th, 0, 0); |
|
| 167 | 165 | XSync(dpy, False); |
|
| 168 | 166 | } |
|