Compare commits
2 Commits
6786398753
...
3afd11471c
Author | SHA1 | Date | |
---|---|---|---|
|
3afd11471c | ||
|
3aae0c42cd |
37
dwm.c
37
dwm.c
@ -866,6 +866,7 @@ drawbar(Monitor *m)
|
||||
int boxs = drw->fonts->h / 9;
|
||||
int boxw = drw->fonts->h / 6 + 2;
|
||||
unsigned int i, occ = 0, urg = 0;
|
||||
int mid;
|
||||
Client *c;
|
||||
|
||||
if (!m->showbar)
|
||||
@ -886,14 +887,17 @@ drawbar(Monitor *m)
|
||||
x = 0;
|
||||
for (i = 0; i < LENGTH(tags); i++) {
|
||||
w = TEXTW(tags[i]);
|
||||
drw_setscheme(drw, scheme[m->tagset[m->seltags] & 1 << i ? SchemeSel : SchemeNorm]);
|
||||
drw_setscheme(drw, scheme[m->tagset[m->seltags] & 1 << i ? SchemeNorm : SchemeNorm]);
|
||||
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' :) */
|
||||
drw_rect(drw, x + ulinepad, bh - ulinestroke - ulinevoffset, w - (ulinepad * 2), ulinestroke, 1, 0);
|
||||
if (occ & 1 << i)
|
||||
drw_rect(drw, x + boxs, boxs, boxw, boxw,
|
||||
m == selmon && selmon->sel && selmon->sel->tags & 1 << 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 (m == selmon)
|
||||
drw_setscheme(drw, scheme[SchemeHid]);
|
||||
drw_rect(drw, x + w * 0.0675, bh - ulinestroke - ulinevoffset, w * 0.875, ulinestroke, 1, 0);
|
||||
} else if (occ & 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;
|
||||
}
|
||||
w = TEXTW(m->ltsymbol);
|
||||
@ -910,9 +914,7 @@ drawbar(Monitor *m)
|
||||
for (c = m->clients; c; c = c->next) {
|
||||
if (!ISVISIBLE(c))
|
||||
continue;
|
||||
if (m->sel == c && m == selmon)
|
||||
scm = SchemeSel;
|
||||
else if (HIDDEN(c))
|
||||
if (HIDDEN(c))
|
||||
scm = SchemeHid;
|
||||
else
|
||||
scm = SchemeNorm;
|
||||
@ -924,7 +926,20 @@ drawbar(Monitor *m)
|
||||
}
|
||||
remainder--;
|
||||
}
|
||||
drw_text(drw, x, 0, tabw, bh, lrpad / 2, c->name, 0);
|
||||
mid = (tabw - (int)TEXTW(c->name)) / 2;
|
||||
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;
|
||||
}
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user