removed TEXTW
5d2385b6
1 file(s) · +5 −10
| 52 | 52 | #define MAXTAGLEN 16 |
|
| 53 | 53 | #define MOUSEMASK (BUTTONMASK|PointerMotionMask) |
|
| 54 | 54 | #define TAGMASK ((int)((1LL << LENGTH(tags)) - 1)) |
|
| 55 | + | #define TEXTW(x) (textnw(x, strlen(x)) + dc.font.height) |
|
| 55 | 56 | #define VISIBLE(x) ((x)->tags & tagset[seltags]) |
|
| 56 | 57 | ||
| 57 | 58 | /* enums */ |
|
| 169 | 170 | void spawn(const void *arg); |
|
| 170 | 171 | void tag(const void *arg); |
|
| 171 | 172 | uint textnw(const char *text, uint len); |
|
| 172 | - | uint textw(const char *text); |
|
| 173 | 173 | void tile(void); |
|
| 174 | 174 | void tileresize(Client *c, int x, int y, int w, int h); |
|
| 175 | 175 | void togglebar(const void *arg); |
|
| 305 | 305 | if(ev->window == barwin) { |
|
| 306 | 306 | x = 0; |
|
| 307 | 307 | for(i = 0; i < LENGTH(tags); i++) { |
|
| 308 | - | x += textw(tags[i]); |
|
| 308 | + | x += TEXTW(tags[i]); |
|
| 309 | 309 | if(ev->x < x) { |
|
| 310 | 310 | mask = 1 << i; |
|
| 311 | 311 | if(ev->button == Button1) { |
|
| 491 | 491 | dc.x = 0; |
|
| 492 | 492 | for(c = stack; c && !VISIBLE(c); c = c->snext); |
|
| 493 | 493 | for(i = 0; i < LENGTH(tags); i++) { |
|
| 494 | - | dc.w = textw(tags[i]); |
|
| 494 | + | dc.w = TEXTW(tags[i]); |
|
| 495 | 495 | if(tagset[seltags] & 1 << i) { |
|
| 496 | 496 | drawtext(tags[i], dc.sel, isurgent(i)); |
|
| 497 | 497 | drawsquare(c && c->tags & 1 << i, isoccupied(i), isurgent(i), dc.sel); |
|
| 509 | 509 | } |
|
| 510 | 510 | else |
|
| 511 | 511 | x = dc.x; |
|
| 512 | - | dc.w = textw(stext); |
|
| 512 | + | dc.w = TEXTW(stext); |
|
| 513 | 513 | dc.x = bw - dc.w; |
|
| 514 | 514 | if(dc.x < x) { |
|
| 515 | 515 | dc.x = x; |
|
| 1365 | 1365 | ||
| 1366 | 1366 | /* init bar */ |
|
| 1367 | 1367 | for(blw = i = 0; LENGTH(layouts) > 1 && i < LENGTH(layouts); i++) { |
|
| 1368 | - | w = textw(layouts[i].symbol); |
|
| 1368 | + | w = TEXTW(layouts[i].symbol); |
|
| 1369 | 1369 | blw = MAX(blw, w); |
|
| 1370 | 1370 | } |
|
| 1371 | 1371 | ||
| 1435 | 1435 | return r.width; |
|
| 1436 | 1436 | } |
|
| 1437 | 1437 | return XTextWidth(dc.font.xfont, text, len); |
|
| 1438 | - | } |
|
| 1439 | - | ||
| 1440 | - | uint |
|
| 1441 | - | textw(const char *text) { |
|
| 1442 | - | return textnw(text, strlen(text)) + dc.font.height; |
|
| 1443 | 1438 | } |
|
| 1444 | 1439 | ||
| 1445 | 1440 | void |
|