underline tags if enabled

This commit is contained in:
speedie 2022-12-06 19:37:04 +01:00
parent 062cb492f3
commit 5225b41335
2 changed files with 9 additions and 2 deletions

View file

@ -74,6 +74,9 @@ draw_tags_pwl(Bar *bar, BarDrawArg *a)
drw_text(drw, x, 0, w, bh, lrpad / 2, tagtext, invert, False);
if (occ & 1 << i && !selmon->hideemptytags)
drw_rect(drw, x + boxs, boxs, boxw, boxw, bar->mon == selmon && selmon->sel && selmon->sel->tags & 1 << i, invert);
if (underline)
if (underlineall || bar->mon->tagset[bar->mon->seltags] & 1 << i)
drw_rect(drw, x + underlinepad, bh - underlinestroke - underlinevoffset, w - (underlinepad * 2), underlinestroke, 1, 0);
x += w;
prevscheme = nxtscheme;

View file

@ -53,17 +53,21 @@ draw_tags(Bar *bar, BarDrawArg *a)
}
for (i = 0; i < LENGTH(tags); i++) {
if (!(occ & 1 << i || m->tagset[m->seltags] & 1 << i) && selmon->hideemptytags)
if (!(occ & 1 << i || bar->mon->tagset[bar->mon->seltags] & 1 << i) && selmon->hideemptytags)
continue;
invert = urg & 1 << i;
tagtext = occ & 1 << i ? usedtags[i] : tags[i];
w = TEXTW(tagtext);
drw_setscheme(drw, (m->tagset[m->seltags] & 1 << i ? tagscheme[i] : scheme[SchemeBar]));
drw_setscheme(drw, (bar->mon->tagset[bar->mon->seltags] & 1 << i ? tagscheme[i] : scheme[SchemeBar]));
drw_text(drw, x, 0, w, bh, lrpad / 2, tagtext, invert, False);
if (occ & 1 << i)
drw_rect(drw, x + boxs, boxs, boxw, boxw,
m == selmon && selmon->sel && selmon->sel->tags & 1 << i, invert);
if (underline)
if (underlineall || bar->mon->tagset[bar->mon->seltags] & 1 << i)
drw_rect(drw, x + underlinepad, bh - underlinestroke - underlinevoffset, w - (underlinepad * 2), underlinestroke, 1, 0);
x += w;
}