infobar: Add color on the occupied tag by clients

Signed-off-by: David Delassus <linkdd62@gmail.com>
This commit is contained in:
David Delassus 2008-12-01 22:26:34 +01:00 committed by Martin Duquesnoy
parent 8eec996d1b
commit aac9b78319
3 changed files with 19 additions and 3 deletions

View File

@ -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)
{

View File

@ -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,

View File

@ -173,6 +173,7 @@ typedef struct
char *text;
char *tagselfg;
uint tagselbg;
uint tag_occupied_bg;
uint tagbord;
char *layout_fg;
uint layout_bg;