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,14 +260,12 @@ bar_draw(Bar *bar)
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 (bar->title) {
drwl_setscheme(bar->drw, colors[bar == selbar ? SchemeSel : SchemeNorm]);
drwl_setscheme(bar->drw, colors[bar == selbar && bar->title ? SchemeSel : SchemeNorm]);
if (bar->title)
drwl_text(bar->drw, x, 0, w, bar->height, bar->lrpad / 2, bar->title, 0);
} else {
drwl_setscheme(bar->drw, colors[SchemeNorm]);
else
drwl_rect(bar->drw, x, 0, w, bar->height, 1, 1);
}
}
drwl_setimage(bar->drw, NULL);
wl_surface_set_buffer_scale(bar->surface, bar->scale);