conf: Add fg_{normal, focus} in titlebar section

This commit is contained in:
Martin Duquesnoy 2009-01-02 08:39:43 +01:00
parent 9bd68ad962
commit c6b6bf2cab
6 changed files with 20 additions and 12 deletions

View File

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

View File

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

View File

@ -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()
};

View File

@ -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);
}

View File

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

5
wmfsrc
View File

@ -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" }