conf: Add fg_{normal, focus} in titlebar section
This commit is contained in:
@@ -143,6 +143,7 @@ client_focus(Client *c)
|
|||||||
if(sel && sel != c)
|
if(sel && sel != c)
|
||||||
{
|
{
|
||||||
sel->colors.frame = conf.client.bordernormal;
|
sel->colors.frame = conf.client.bordernormal;
|
||||||
|
sel->colors.fg = conf.titlebar.fg_normal;
|
||||||
sel->colors.resizecorner = conf.client.resizecorner_normal;
|
sel->colors.resizecorner = conf.client.resizecorner_normal;
|
||||||
frame_update(sel);
|
frame_update(sel);
|
||||||
mouse_grabbuttons(sel, False);
|
mouse_grabbuttons(sel, False);
|
||||||
@@ -153,6 +154,7 @@ client_focus(Client *c)
|
|||||||
if(c)
|
if(c)
|
||||||
{
|
{
|
||||||
c->colors.frame = conf.client.borderfocus;
|
c->colors.frame = conf.client.borderfocus;
|
||||||
|
c->colors.fg = conf.titlebar.fg_focus;
|
||||||
c->colors.resizecorner = conf.client.resizecorner_focus;
|
c->colors.resizecorner = conf.client.resizecorner_focus;
|
||||||
frame_update(c);
|
frame_update(c);
|
||||||
mouse_grabbuttons(c, True);
|
mouse_grabbuttons(c, True);
|
||||||
|
|||||||
11
src/config.c
11
src/config.c
@@ -123,11 +123,12 @@ conf_client_section(cfg_t *cfg_c)
|
|||||||
mouse_section(conf.client.mouse, cfg_c, conf.client.nmouse);
|
mouse_section(conf.client.mouse, cfg_c, conf.client.nmouse);
|
||||||
|
|
||||||
/* Titlebar part */
|
/* Titlebar part */
|
||||||
cfgtmp = cfg_getsec(cfg_c, "titlebar");
|
cfgtmp = cfg_getsec(cfg_c, "titlebar");
|
||||||
conf.titlebar.height = cfg_getint(cfgtmp, "height");
|
conf.titlebar.height = cfg_getint(cfgtmp, "height");
|
||||||
conf.titlebar.fg = alias_to_str(cfg_getstr(cfgtmp, "fg"));
|
conf.titlebar.fg_normal = alias_to_str(cfg_getstr(cfgtmp, "fg_normal"));
|
||||||
conf.titlebar.nmouse = cfg_size(cfgtmp, "mouse");
|
conf.titlebar.fg_focus = alias_to_str(cfg_getstr(cfgtmp, "fg_focus"));
|
||||||
conf.titlebar.mouse = emalloc(conf.titlebar.nmouse, sizeof(MouseBinding));
|
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);
|
mouse_section(conf.titlebar.mouse, cfgtmp, conf.titlebar.nmouse);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -72,9 +72,10 @@ cfg_opt_t root_opts[] =
|
|||||||
|
|
||||||
cfg_opt_t titlebar_opts[] =
|
cfg_opt_t titlebar_opts[] =
|
||||||
{
|
{
|
||||||
CFG_INT("height", 0, CFGF_NONE),
|
CFG_INT("height", 0, CFGF_NONE),
|
||||||
CFG_STR("fg", "#FFFFFF", CFGF_NONE),
|
CFG_STR("fg_normal", "#FFFFFF", CFGF_NONE),
|
||||||
CFG_SEC("mouse", mouse_button_opts, CFGF_MULTI),
|
CFG_STR("fg_focus", "#FFFFFF", CFGF_NONE),
|
||||||
|
CFG_SEC("mouse", mouse_button_opts, CFGF_MULTI),
|
||||||
CFG_END()
|
CFG_END()
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -55,6 +55,7 @@ frame_create(Client *c)
|
|||||||
c->frame_geo.y = c->geo.y - TBARH;
|
c->frame_geo.y = c->geo.y - TBARH;
|
||||||
c->frame_geo.width = FRAMEW(c->geo.width);
|
c->frame_geo.width = FRAMEW(c->geo.width);
|
||||||
c->frame_geo.height = FRAMEH(c->geo.height);
|
c->frame_geo.height = FRAMEH(c->geo.height);
|
||||||
|
c->colors.fg = conf.titlebar.fg_normal;
|
||||||
c->colors.frame = conf.client.bordernormal;
|
c->colors.frame = conf.client.bordernormal;
|
||||||
c->colors.resizecorner = conf.client.resizecorner_normal;
|
c->colors.resizecorner = conf.client.resizecorner_normal;
|
||||||
|
|
||||||
@@ -187,7 +188,7 @@ frame_update(Client *c)
|
|||||||
draw_text(c->titlebar->dr,
|
draw_text(c->titlebar->dr,
|
||||||
(c->frame_geo.width / 2) - (textw(c->title) / 2),
|
(c->frame_geo.width / 2) - (textw(c->title) / 2),
|
||||||
(font->height - (font->descent)) + (((TBARH + BORDH) - font->height) / 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);
|
barwin_refresh(c->titlebar);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -133,6 +133,7 @@ struct Client
|
|||||||
struct
|
struct
|
||||||
{
|
{
|
||||||
uint frame;
|
uint frame;
|
||||||
|
char *fg;
|
||||||
uint resizecorner;
|
uint resizecorner;
|
||||||
} colors;
|
} colors;
|
||||||
/* Client Information */
|
/* Client Information */
|
||||||
@@ -241,7 +242,8 @@ typedef struct
|
|||||||
struct
|
struct
|
||||||
{
|
{
|
||||||
int height;
|
int height;
|
||||||
char *fg;
|
char *fg_normal;
|
||||||
|
char *fg_focus;
|
||||||
MouseBinding *mouse;
|
MouseBinding *mouse;
|
||||||
int nmouse;
|
int nmouse;
|
||||||
} titlebar;
|
} titlebar;
|
||||||
|
|||||||
5
wmfsrc
5
wmfsrc
@@ -81,8 +81,9 @@ client
|
|||||||
|
|
||||||
titlebar
|
titlebar
|
||||||
{
|
{
|
||||||
height = 11
|
height = 11
|
||||||
fg = "#D4D4D4"
|
fg_normal = "#D4D4D4"
|
||||||
|
fg_focus = "#D4D4D4"
|
||||||
|
|
||||||
mouse { button = "1" func = "client_raise" }
|
mouse { button = "1" func = "client_raise" }
|
||||||
mouse { button = "1" func = "mouse_move" }
|
mouse { button = "1" func = "mouse_move" }
|
||||||
|
|||||||
Reference in New Issue
Block a user