center basic title, c->name in basic title
improve title.c cleanup speedwm.c
This commit is contained in:
parent
5225b41335
commit
88e8956896
|
@ -18,7 +18,9 @@ draw_title_basic(Bar *bar, BarDrawArg *a)
|
|||
int boxs = drw->font->h / 9;
|
||||
int boxw = drw->font->h / 6 + 2;
|
||||
int x = a->x, w = a->w;
|
||||
int padding = lrpad / 2;
|
||||
Monitor *m = bar->mon;
|
||||
Client *c = m->sel;
|
||||
|
||||
if (m->sel) {
|
||||
if (colorselectedtitle)
|
||||
|
@ -26,9 +28,14 @@ draw_title_basic(Bar *bar, BarDrawArg *a)
|
|||
else
|
||||
drw_setscheme(drw, scheme[m == selmon ? SchemeTitleNorm : SchemeTitleNorm]);
|
||||
|
||||
drw_text(drw, x, 0, w, bh, lrpad / 2, m->sel->name, 0, False);
|
||||
if (m->sel->isfloating)
|
||||
drw_rect(drw, x + boxs, boxs, boxw, boxw, m->sel->isfixed, 0);
|
||||
if (TEXTW(c->name) < w && titleposition)
|
||||
padding = (w - TEXTW(c->name) + lrpad) / 2;
|
||||
|
||||
drw_text(drw, x, 0, w, bh, padding, c->name, 0, False);
|
||||
if (c->isfloating && !selmon->hidefloating)
|
||||
drw_rect(drw, x + boxs, boxs, boxw, boxw, c->isfixed, 0);
|
||||
if (c->issticky && !selmon->hidesticky)
|
||||
drw_polygon(drw, x + boxs, c->isfloating ? boxs * 2 + boxw : boxs, stickyiconbb.x, stickyiconbb.y, boxw, boxw * stickyiconbb.y / stickyiconbb.x, stickyicon, LENGTH(stickyicon), Nonconvex, c->tags & bar->mon->tagset[bar->mon->seltags]);
|
||||
} else {
|
||||
drw_setscheme(drw, scheme[SchemeBar]);
|
||||
drw_rect(drw, x, 0, w, bh, 1, 1);
|
||||
|
|
|
@ -18,8 +18,8 @@ draw_title(Bar *bar, BarDrawArg *a)
|
|||
int n = 0, scm, remainder = 0, tabw, padding;
|
||||
unsigned int i;
|
||||
int x = a->x, w = a->w;
|
||||
Client *c;
|
||||
|
||||
Client *c;
|
||||
for (c = bar->mon->clients; c; c = c->next)
|
||||
if (ISVISIBLE(c))
|
||||
n++;
|
||||
|
@ -51,6 +51,7 @@ draw_title(Bar *bar, BarDrawArg *a)
|
|||
#else
|
||||
drw_text(drw, x, 0, tabw + padding (i < remainder ? 1 : 0), bh, padding, c->name, 0, False);
|
||||
#endif
|
||||
|
||||
x += tabw + (i < remainder ? 1 : 0);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -870,7 +870,6 @@ static xcb_connection_t *xcon;
|
|||
#define SUPERR Mod5Mask
|
||||
|
||||
/* Shell command */
|
||||
#define RCMD(cmd) {.v = (const char*[]){ shell, "-c", cmd, NULL } },
|
||||
#define cmd( cmd ) {.v = (const char*[]){ shell, "-c", cmd, NULL } },
|
||||
|
||||
static const char *clickstatus[] = { "/bin/sh", "-c", NULL, NULL }; /* for running click scripts */
|
||||
|
|
Loading…
Reference in a new issue