Add feature #28 requested by arpinux: client_free_statusline in theme section

This commit is contained in:
Martin Duquesnoy 2012-02-26 13:18:00 +01:00
parent 0e61b49467
commit 6f43efed44
3 changed files with 19 additions and 6 deletions

View File

@ -370,11 +370,20 @@ client_grabbuttons(struct client *c, bool focused)
if((rm = ((x + f) - (c->rgeo.w - c->border))) > 0) \
f -= rm;
#define _STATUSLINE(C, b) \
sctx = (b ? &c->theme->client_s_sl : &c->theme->client_n_sl); \
sctx->barwin = C->titlebar; \
status_copy_mousebind(sctx); \
status_render(sctx);
#define _STATUSLINE(C, b) \
do { \
sctx = (b ? &c->theme->client_s_sl : &c->theme->client_n_sl); \
sctx->barwin = C->titlebar; \
status_copy_mousebind(sctx); \
status_render(sctx); \
if(C->flags & CLIENT_FREE) \
{ \
sctx = &c->theme->client_f_sl; \
sctx->barwin = C->titlebar; \
status_copy_mousebind(sctx); \
status_render(sctx); \
} \
} while(/* CONSTCOND */ 0);
void
client_frame_update(struct client *c, struct colpair *cp)
{

View File

@ -122,14 +122,18 @@ config_theme(void)
/* status line */
t->client_n_sl = status_new_ctx(NULL, t);
t->client_s_sl = status_new_ctx(NULL, t);
t->client_f_sl = status_new_ctx(NULL, t);
ISTRDUP(t->client_n_sl.status, fetch_opt_first(ks[i], "", "client_normal_statusline").str);
ISTRDUP(t->client_s_sl.status, fetch_opt_first(ks[i], "", "client_sel_statusline").str);
ISTRDUP(t->client_f_sl.status, fetch_opt_first(ks[i], "", "client_free_statusline").str);
if(t->client_n_sl.status)
status_parse(&t->client_n_sl);
if(t->client_s_sl.status)
status_parse(&t->client_s_sl);
if(t->client_f_sl.status)
status_parse(&t->client_f_sl);
SLIST_INSERT_TAIL(&W->h.theme, t, next, p);

View File

@ -273,7 +273,7 @@ struct theme
/* client / frame */
struct colpair client_n, client_s;
struct status_ctx client_n_sl, client_s_sl;
struct status_ctx client_n_sl, client_s_sl, client_f_sl;
Color frame_bg;
int client_titlebar_width;
int client_border_width;