simplify title scheme set

This commit is contained in:
sewn 2025-02-14 10:52:38 +03:00
parent e6eb713fb3
commit f36ce99d80
No known key found for this signature in database

8
dam.c
View file

@ -260,13 +260,11 @@ bar_draw(Bar *bar)
x = drwl_text(bar->drw, x, 0, w, bar->height, bar->lrpad / 2, bar->layout, 0); x = drwl_text(bar->drw, x, 0, w, bar->height, bar->lrpad / 2, bar->layout, 0);
if ((w = bar->width - tw - x) > bar->height) { if ((w = bar->width - tw - x) > bar->height) {
if (bar->title) { drwl_setscheme(bar->drw, colors[bar == selbar && bar->title ? SchemeSel : SchemeNorm]);
drwl_setscheme(bar->drw, colors[bar == selbar ? SchemeSel : SchemeNorm]); if (bar->title)
drwl_text(bar->drw, x, 0, w, bar->height, bar->lrpad / 2, bar->title, 0); drwl_text(bar->drw, x, 0, w, bar->height, bar->lrpad / 2, bar->title, 0);
} else { else
drwl_setscheme(bar->drw, colors[SchemeNorm]);
drwl_rect(bar->drw, x, 0, w, bar->height, 1, 1); drwl_rect(bar->drw, x, 0, w, bar->height, 1, 1);
}
} }
drwl_setimage(bar->drw, NULL); drwl_setimage(bar->drw, NULL);