Refinement
This commit is contained in:
@@ -1,29 +1,33 @@
|
||||
int
|
||||
width_fancybar(Monitor *m, BarWidthArg *a)
|
||||
width_fancybar(Bar *bar, BarWidthArg *a)
|
||||
{
|
||||
return a->max_width;
|
||||
}
|
||||
|
||||
int
|
||||
draw_fancybar(Monitor *m, BarDrawArg *a)
|
||||
draw_fancybar(Bar *bar, BarDrawArg *a)
|
||||
{
|
||||
int ftw, mw, ew = 0, n = 0, x = a->x, w = a->w;
|
||||
int ftw, mw, ew = 0, n = 0;
|
||||
unsigned int i;
|
||||
Client *c;
|
||||
#if !BAR_HIDEVACANTTAGS_PATCH
|
||||
#if !BAR_ACTIVETAGINDICATORBAR_PATCH && !BAR_ACTIVETAGINDICATORBAR_ALT1_PATCH
|
||||
Monitor *m = bar->mon;
|
||||
|
||||
#if BAR_PANGO_PATCH
|
||||
int boxs = drw->font->h / 9;
|
||||
#else
|
||||
int boxs = drw->fonts->h / 9;
|
||||
#endif // BAR_PANGO_PATCH
|
||||
#endif // BAR_ACTIVETAGINDICATORBAR_PATCH | BAR_ACTIVETAGINDICATORBAR_ALT1_PATCH
|
||||
#if BAR_PANGO_PATCH
|
||||
int boxw = drw->font->h / 6 + 2;
|
||||
#else
|
||||
int boxs = drw->fonts->h / 9;
|
||||
int boxw = drw->fonts->h / 6 + 2;
|
||||
#endif // BAR_PANGO_PATCH
|
||||
#endif // BAR_HIDEVACANTTAGS_PATCH
|
||||
#if BAR_TITLE_LEFT_PAD && BAR_TITLE_RIGHT_PAD
|
||||
int x = a->x + lrpad / 2, w = a->w - lrpad;
|
||||
#elif BAR_TITLE_LEFT_PAD
|
||||
int x = a->x + lrpad / 2, w = a->w - lrpad / 2;
|
||||
#elif BAR_TITLE_RIGHT_PAD
|
||||
int x = a->x, w = a->w - lrpad / 2;
|
||||
#else
|
||||
int x = a->x, w = a->w;
|
||||
#endif // BAR_TITLE_LEFT_PAD | BAR_TITLE_RIGHT_PAD
|
||||
|
||||
for (c = m->clients; c; c = c->next) {
|
||||
if (ISVISIBLE(c))
|
||||
@@ -31,10 +35,11 @@ draw_fancybar(Monitor *m, BarDrawArg *a)
|
||||
}
|
||||
|
||||
if (n > 0) {
|
||||
ftw = TEXTW(m->sel->name) + lrpad;
|
||||
ftw = TEXTW(m->sel->name);
|
||||
mw = (ftw >= w || n == 1) ? 0 : (w - ftw) / (n - 1);
|
||||
|
||||
i = 0;
|
||||
|
||||
for (c = m->clients; c; c = c->next) {
|
||||
if (!ISVISIBLE(c) || c == m->sel)
|
||||
continue;
|
||||
@@ -44,6 +49,7 @@ draw_fancybar(Monitor *m, BarDrawArg *a)
|
||||
else
|
||||
i++;
|
||||
}
|
||||
|
||||
if (i > 0)
|
||||
mw += ew / i;
|
||||
|
||||
@@ -65,31 +71,17 @@ draw_fancybar(Monitor *m, BarDrawArg *a)
|
||||
#else
|
||||
drw_text(drw, x, 0, ftw, bh, lrpad / 2, c->name, 0);
|
||||
#endif // BAR_PANGO_PATCH
|
||||
#if !BAR_HIDEVACANTTAGS_PATCH
|
||||
if (c->isfloating)
|
||||
#if BAR_ACTIVETAGINDICATORBAR_PATCH
|
||||
drw_rect(drw, x + boxw, 0, w - ( 2 * boxw + 1), boxw, c->isfixed, 0);
|
||||
#elif BAR_ACTIVETAGINDICATORBAR_ALT1_PATCH
|
||||
drw_rect(drw, x + boxw, bh - boxw/2, w - ( 2 * boxw + 1), boxw/2,
|
||||
#else
|
||||
drw_rect(drw, x + boxs, boxs, boxw, boxw, c->isfixed, 0);
|
||||
#endif // BAR_ACTIVETAGINDICATORBAR_PATCH
|
||||
#endif // BAR_HIDEVACANTTAGS_PATCH
|
||||
x += ftw;
|
||||
w -= ftw;
|
||||
}
|
||||
}
|
||||
#if BAR_VTCOLORS_PATCH
|
||||
drw_setscheme(drw, scheme[SchemeTitleNorm]);
|
||||
#else
|
||||
drw_setscheme(drw, scheme[SchemeNorm]);
|
||||
#endif // BAR_VTCOLORS_PATCH
|
||||
drw_rect(drw, x, 0, w, bh, 1, 1);
|
||||
return x + w;
|
||||
}
|
||||
|
||||
int
|
||||
click_fancybar(Monitor *m, Arg *arg, BarClickArg *a)
|
||||
click_fancybar(Bar *bar, Arg *arg, BarClickArg *a)
|
||||
{
|
||||
return ClkWinTitle;
|
||||
}
|
||||
|
Reference in New Issue
Block a user