infobar: Add color on the occupied tag by clients
Signed-off-by: David Delassus <linkdd62@gmail.com>
This commit is contained in:
parent
8eec996d1b
commit
aac9b78319
@ -126,6 +126,7 @@ static cfg_opt_t tag_opts[] =
|
||||
|
||||
static cfg_opt_t tags_opts[] =
|
||||
{
|
||||
CFG_STR("occupied_bg", "#003366", CFGF_NONE),
|
||||
CFG_STR("sel_fg", "#FFFFFF", CFGF_NONE),
|
||||
CFG_STR("sel_bg", "#354B5C", CFGF_NONE),
|
||||
CFG_STR("border", "#090909", CFGF_NONE),
|
||||
@ -454,9 +455,10 @@ init_conf(void)
|
||||
* If there is no tag in the conf or more than
|
||||
* MAXTAG (32) print an error and create only one.
|
||||
*/
|
||||
conf.colors.tagselfg = strdup(var_to_str(cfg_getstr(cfg_tags, "sel_fg")));
|
||||
conf.colors.tagselbg = getcolor(var_to_str(cfg_getstr(cfg_tags, "sel_bg")));
|
||||
conf.colors.tagbord = getcolor(var_to_str(cfg_getstr(cfg_tags, "border")));
|
||||
conf.colors.tagselfg = strdup(var_to_str(cfg_getstr(cfg_tags, "sel_fg")));
|
||||
conf.colors.tagselbg = getcolor(var_to_str(cfg_getstr(cfg_tags, "sel_bg")));
|
||||
conf.colors.tag_occupied_bg = getcolor(var_to_str(cfg_getstr(cfg_tags, "occupied_bg")));
|
||||
conf.colors.tagbord = getcolor(var_to_str(cfg_getstr(cfg_tags, "border")));
|
||||
|
||||
/* Alloc all */
|
||||
conf.ntag = emalloc(screen_count(), sizeof(int));
|
||||
@ -478,6 +480,7 @@ init_conf(void)
|
||||
tags[j][conf.ntag[j]].resizehint = cfg_getbool(cfgtmp, "resizehint");
|
||||
tags[j][conf.ntag[j]].layout = layout_name_to_struct(conf.layout, cfg_getstr(cfgtmp, "layout"), conf.nlayout);
|
||||
}
|
||||
|
||||
for(i = 0; i < screen_count(); ++i)
|
||||
if(!conf.ntag[i] || conf.ntag[i] > MAXTAG)
|
||||
{
|
||||
|
||||
@ -127,8 +127,20 @@ infobar_draw_taglist(int sc)
|
||||
|
||||
for(i = 1; i < conf.ntag[sc] + 1; ++i)
|
||||
{
|
||||
Client *c;
|
||||
|
||||
infobar[sc].tags[i]->color = ((i == seltag[sc]) ? conf.colors.tagselbg : conf.colors.bar);
|
||||
barwin_refresh_color(infobar[sc].tags[i]);
|
||||
|
||||
for(c = clients; c; c = c->next)
|
||||
{
|
||||
if(c->screen == sc)
|
||||
{
|
||||
infobar[sc].tags[c->tag]->color = ((c->tag == seltag[sc]) ? conf.colors.tagselbg : conf.colors.tag_occupied_bg);
|
||||
barwin_refresh_color(infobar[sc].tags[i]);
|
||||
}
|
||||
}
|
||||
|
||||
if(tags[sc][i].name)
|
||||
draw_text(infobar[sc].tags[i]->dr,
|
||||
PAD / 2,
|
||||
|
||||
@ -173,6 +173,7 @@ typedef struct
|
||||
char *text;
|
||||
char *tagselfg;
|
||||
uint tagselbg;
|
||||
uint tag_occupied_bg;
|
||||
uint tagbord;
|
||||
char *layout_fg;
|
||||
uint layout_bg;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user