Compare commits

..

No commits in common. "3afd11471c732b0e818f30429599cb205862ddeb" and "678639875396ce0ce34cd6f976432b80df7cc27f" have entirely different histories.

2 changed files with 11 additions and 32 deletions

37
dwm.c
View File

@ -866,7 +866,6 @@ drawbar(Monitor *m)
int boxs = drw->fonts->h / 9; int boxs = drw->fonts->h / 9;
int boxw = drw->fonts->h / 6 + 2; int boxw = drw->fonts->h / 6 + 2;
unsigned int i, occ = 0, urg = 0; unsigned int i, occ = 0, urg = 0;
int mid;
Client *c; Client *c;
if (!m->showbar) if (!m->showbar)
@ -887,17 +886,14 @@ drawbar(Monitor *m)
x = 0; x = 0;
for (i = 0; i < LENGTH(tags); i++) { for (i = 0; i < LENGTH(tags); i++) {
w = TEXTW(tags[i]); w = TEXTW(tags[i]);
drw_setscheme(drw, scheme[m->tagset[m->seltags] & 1 << i ? SchemeNorm : SchemeNorm]); drw_setscheme(drw, scheme[m->tagset[m->seltags] & 1 << i ? SchemeSel : SchemeNorm]);
drw_text(drw, x, 0, w, bh, lrpad / 2, tags[i], urg & 1 << i); drw_text(drw, x, 0, w, bh, lrpad / 2, tags[i], urg & 1 << i);
if (ulineall || m->tagset[m->seltags] & 1 << i) /* if there are conflicts, just move these lines directly underneath both 'drw_setscheme' and 'drw_text' :) */
if (ulineall || m->tagset[m->seltags] & 1 << i) { /* if there are conflicts, just move these lines directly underneath both 'drw_setscheme' and 'drw_text' :) */ drw_rect(drw, x + ulinepad, bh - ulinestroke - ulinevoffset, w - (ulinepad * 2), ulinestroke, 1, 0);
if (m == selmon) if (occ & 1 << i)
drw_setscheme(drw, scheme[SchemeHid]); drw_rect(drw, x + boxs, boxs, boxw, boxw,
drw_rect(drw, x + w * 0.0675, bh - ulinestroke - ulinevoffset, w * 0.875, ulinestroke, 1, 0); m == selmon && selmon->sel && selmon->sel->tags & 1 << i,
} else if (occ & 1 << i) { urg & 1 << i);
drw_setscheme(drw, scheme[SchemeNorm]);
drw_rect(drw, x + w * 0.375, bh - ulinestroke - ulinevoffset, w * 0.25, ulinestroke, 1, 0);
}
x += w; x += w;
} }
w = TEXTW(m->ltsymbol); w = TEXTW(m->ltsymbol);
@ -914,7 +910,9 @@ drawbar(Monitor *m)
for (c = m->clients; c; c = c->next) { for (c = m->clients; c; c = c->next) {
if (!ISVISIBLE(c)) if (!ISVISIBLE(c))
continue; continue;
if (HIDDEN(c)) if (m->sel == c && m == selmon)
scm = SchemeSel;
else if (HIDDEN(c))
scm = SchemeHid; scm = SchemeHid;
else else
scm = SchemeNorm; scm = SchemeNorm;
@ -926,20 +924,7 @@ drawbar(Monitor *m)
} }
remainder--; remainder--;
} }
mid = (tabw - (int)TEXTW(c->name)) / 2; drw_text(drw, x, 0, tabw, bh, lrpad / 2, c->name, 0);
mid = mid >= lrpad / 2 ? mid : lrpad / 2;
drw_text(drw, x, 0, tabw, bh, mid, c->name, 0);
if (!HIDDEN(c)) {
if (m->sel == c) {
if (m == selmon)
drw_setscheme(drw, scheme[SchemeHid]);
drw_rect(drw, x + tabw * 0.0675, bh - ulinestroke - ulinevoffset, tabw * 0.875 - ulinepad * 2, ulinestroke, 1, 0);
} else {
drw_rect(drw, x + tabw * 0.375, bh - ulinestroke - ulinevoffset, tabw * 0.25 - ulinepad * 2, ulinestroke, 1, 0);
}
}
x += tabw; x += tabw;
} }
} else { } else {

View File

@ -1,6 +0,0 @@
# DWM Todo
## Bar
- [ ] add `config.def.h` options for window name & tag underline colors and
widths
- [ ] and drawbar is a mess from that ^ so clean it up