diff options
author | Hiltjo Posthuma <hiltjo@codemadness.org> | 2015-10-20 23:34:49 +0200 |
---|---|---|
committer | Hiltjo Posthuma <hiltjo@codemadness.org> | 2015-10-20 23:38:31 +0200 |
commit | 646b351cc79845f4cc77415dfff474b9ae0053d9 (patch) | |
tree | d3de639691f7f845a705007e93560160d3b3ee5c /dwm.c | |
parent | e3b7e1d620e18818222c1e5033356ae29dd49e7f (diff) | |
download | dwm-646b351cc79845f4cc77415dfff474b9ae0053d9.tar.gz dwm-646b351cc79845f4cc77415dfff474b9ae0053d9.tar.bz2 dwm-646b351cc79845f4cc77415dfff474b9ae0053d9.zip |
sync updated drw code from dmenu
important:
- drw_rect: didn't use w and h, change the dwm code accordingly.
- drw_text: text is NULL is not allowed, use drw_rect().
Diffstat (limited to 'dwm.c')
-rw-r--r-- | dwm.c | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -689,10 +689,12 @@ dirtomon(int dir) { void drawbar(Monitor *m) { - int x, xx, w; + int x, xx, w, dx; unsigned int i, occ = 0, urg = 0; Client *c; + dx = (drw->fonts[0]->ascent + drw->fonts[0]->descent + 2) / 4; + for(c = m->clients; c; c = c->next) { occ |= c->tags; if(c->isurgent) @@ -703,7 +705,7 @@ drawbar(Monitor *m) { w = TEXTW(tags[i]); drw_setscheme(drw, m->tagset[m->seltags] & 1 << i ? &scheme[SchemeSel] : &scheme[SchemeNorm]); drw_text(drw, x, 0, w, bh, tags[i], urg & 1 << i); - drw_rect(drw, x, 0, w, bh, m == selmon && selmon->sel && selmon->sel->tags & 1 << i, + drw_rect(drw, x + 1, 1, dx, dx, m == selmon && selmon->sel && selmon->sel->tags & 1 << i, occ & 1 << i, urg & 1 << i); x += w; } @@ -728,11 +730,11 @@ drawbar(Monitor *m) { if(m->sel) { drw_setscheme(drw, m == selmon ? &scheme[SchemeSel] : &scheme[SchemeNorm]); drw_text(drw, x, 0, w, bh, m->sel->name, 0); - drw_rect(drw, x, 0, w, bh, m->sel->isfixed, m->sel->isfloating, 0); + drw_rect(drw, x + 1, 1, dx, dx, m->sel->isfixed, m->sel->isfloating, 0); } else { drw_setscheme(drw, &scheme[SchemeNorm]); - drw_text(drw, x, 0, w, bh, NULL, 0); + drw_rect(drw, x, 0, w, bh, 1, 0, 1); } } drw_map(drw, m->barwin, 0, 0, m->ww, bh); |