diff --git a/src/client.c b/src/client.c index 9574620..127f387 100644 --- a/src/client.c +++ b/src/client.c @@ -143,6 +143,7 @@ client_focus(Client *c) if(sel && sel != c) { sel->colors.frame = conf.client.bordernormal; + sel->colors.fg = conf.titlebar.fg_normal; sel->colors.resizecorner = conf.client.resizecorner_normal; frame_update(sel); mouse_grabbuttons(sel, False); @@ -153,6 +154,7 @@ client_focus(Client *c) if(c) { c->colors.frame = conf.client.borderfocus; + c->colors.fg = conf.titlebar.fg_focus; c->colors.resizecorner = conf.client.resizecorner_focus; frame_update(c); mouse_grabbuttons(c, True); diff --git a/src/config.c b/src/config.c index 7124009..5f41587 100644 --- a/src/config.c +++ b/src/config.c @@ -123,11 +123,12 @@ conf_client_section(cfg_t *cfg_c) mouse_section(conf.client.mouse, cfg_c, conf.client.nmouse); /* Titlebar part */ - cfgtmp = cfg_getsec(cfg_c, "titlebar"); - conf.titlebar.height = cfg_getint(cfgtmp, "height"); - conf.titlebar.fg = alias_to_str(cfg_getstr(cfgtmp, "fg")); - conf.titlebar.nmouse = cfg_size(cfgtmp, "mouse"); - conf.titlebar.mouse = emalloc(conf.titlebar.nmouse, sizeof(MouseBinding)); + cfgtmp = cfg_getsec(cfg_c, "titlebar"); + conf.titlebar.height = cfg_getint(cfgtmp, "height"); + conf.titlebar.fg_normal = alias_to_str(cfg_getstr(cfgtmp, "fg_normal")); + conf.titlebar.fg_focus = alias_to_str(cfg_getstr(cfgtmp, "fg_focus")); + conf.titlebar.nmouse = cfg_size(cfgtmp, "mouse"); + conf.titlebar.mouse = emalloc(conf.titlebar.nmouse, sizeof(MouseBinding)); mouse_section(conf.titlebar.mouse, cfgtmp, conf.titlebar.nmouse); return; diff --git a/src/config_struct.h b/src/config_struct.h index 4d49a10..4d6538c 100644 --- a/src/config_struct.h +++ b/src/config_struct.h @@ -72,9 +72,10 @@ cfg_opt_t root_opts[] = cfg_opt_t titlebar_opts[] = { - CFG_INT("height", 0, CFGF_NONE), - CFG_STR("fg", "#FFFFFF", CFGF_NONE), - CFG_SEC("mouse", mouse_button_opts, CFGF_MULTI), + CFG_INT("height", 0, CFGF_NONE), + CFG_STR("fg_normal", "#FFFFFF", CFGF_NONE), + CFG_STR("fg_focus", "#FFFFFF", CFGF_NONE), + CFG_SEC("mouse", mouse_button_opts, CFGF_MULTI), CFG_END() }; diff --git a/src/frame.c b/src/frame.c index fd4af9d..c389ee9 100644 --- a/src/frame.c +++ b/src/frame.c @@ -55,6 +55,7 @@ frame_create(Client *c) c->frame_geo.y = c->geo.y - TBARH; c->frame_geo.width = FRAMEW(c->geo.width); c->frame_geo.height = FRAMEH(c->geo.height); + c->colors.fg = conf.titlebar.fg_normal; c->colors.frame = conf.client.bordernormal; c->colors.resizecorner = conf.client.resizecorner_normal; @@ -187,7 +188,7 @@ frame_update(Client *c) draw_text(c->titlebar->dr, (c->frame_geo.width / 2) - (textw(c->title) / 2), (font->height - (font->descent)) + (((TBARH + BORDH) - font->height) / 2), - conf.titlebar.fg, 0, c->title); + c->colors.fg, 0, c->title); barwin_refresh(c->titlebar); } diff --git a/src/structs.h b/src/structs.h index 84f1f8d..9b82581 100644 --- a/src/structs.h +++ b/src/structs.h @@ -133,6 +133,7 @@ struct Client struct { uint frame; + char *fg; uint resizecorner; } colors; /* Client Information */ @@ -241,7 +242,8 @@ typedef struct struct { int height; - char *fg; + char *fg_normal; + char *fg_focus; MouseBinding *mouse; int nmouse; } titlebar; diff --git a/wmfsrc b/wmfsrc index 903c2bf..6360415 100644 --- a/wmfsrc +++ b/wmfsrc @@ -81,8 +81,9 @@ client titlebar { - height = 11 - fg = "#D4D4D4" + height = 11 + fg_normal = "#D4D4D4" + fg_focus = "#D4D4D4" mouse { button = "1" func = "client_raise" } mouse { button = "1" func = "mouse_move" }