dam: hide vacant tags
This commit is contained in:
parent
3a7252c781
commit
6fa8e80ecb
1 changed files with 6 additions and 9 deletions
15
dam.c
15
dam.c
|
@ -218,8 +218,6 @@ static void
|
||||||
bar_draw(Bar *bar)
|
bar_draw(Bar *bar)
|
||||||
{
|
{
|
||||||
int x = 0, w, tw = 0;
|
int x = 0, w, tw = 0;
|
||||||
int boxs = bar->drw->font->height / 9;
|
|
||||||
int boxw = bar->drw->font->height / 6 + 2;
|
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
DrwBuf *buf;
|
DrwBuf *buf;
|
||||||
|
|
||||||
|
@ -239,13 +237,11 @@ bar_draw(Bar *bar)
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < LENGTH(tags); i++) {
|
for (i = 0; i < LENGTH(tags); i++) {
|
||||||
|
if (!((bar->mtags | bar->ctags | bar->urg) & 1 << i))
|
||||||
|
continue;
|
||||||
w = TEXTW(bar, tags[i]);
|
w = TEXTW(bar, tags[i]);
|
||||||
drwl_setscheme(bar->drw, colors[bar->mtags & 1 << i ? SchemeSel : SchemeNorm]);
|
drwl_setscheme(bar->drw, colors[bar->mtags & 1 << i ? SchemeSel : SchemeNorm]);
|
||||||
drwl_text(bar->drw, x, 0, w, bar->height, bar->lrpad / 2, tags[i], bar->urg & 1 << i);
|
drwl_text(bar->drw, x, 0, w, bar->height, bar->lrpad / 2, tags[i], bar->urg & 1 << i);
|
||||||
if (bar->ctags & 1 << i)
|
|
||||||
drwl_rect(bar->drw, x + boxs, boxs, boxw, boxw,
|
|
||||||
bar->mtags & 1 << i && bar == selbar,
|
|
||||||
bar->urg & 1 << i);
|
|
||||||
x += w;
|
x += w;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -582,9 +578,10 @@ pointer_handle_frame(void *data, struct wl_pointer *wl_pointer)
|
||||||
|
|
||||||
lw = TEXTW(selbar, selbar->layout);
|
lw = TEXTW(selbar, selbar->layout);
|
||||||
|
|
||||||
do
|
do {
|
||||||
x += TEXTW(selbar, tags[i]);
|
if ((selbar->mtags | selbar->ctags | selbar->urg) & 1 << i)
|
||||||
while (pointer.x >= x && ++i < LENGTH(tags));
|
x += TEXTW(selbar, tags[i]);
|
||||||
|
} while (pointer.x >= x && ++i < LENGTH(tags));
|
||||||
|
|
||||||
if (i < LENGTH(tags)) {
|
if (i < LENGTH(tags)) {
|
||||||
click = ClkTagBar;
|
click = ClkTagBar;
|
||||||
|
|
Loading…
Add table
Reference in a new issue