[bar config] Add border under tag list (when tag_border_width > 0)

This commit is contained in:
Martin Duquesnoy 2008-10-09 22:00:05 +02:00
parent ec42111a32
commit 7f16933904
4 changed files with 27 additions and 17 deletions

View File

@ -155,12 +155,12 @@ init_conf(void)
static cfg_opt_t misc_opts[] =
{
CFG_STR("bar_position", "top", CFGF_NONE),
CFG_BOOL("raisefocus", cfg_false, CFGF_NONE),
CFG_BOOL("raiseswitch", cfg_true, CFGF_NONE),
CFG_INT("border_height", 1, CFGF_NONE),
CFG_INT("titlebar_height", 0, CFGF_NONE),
CFG_INT("tag_separation_width", 0, CFGF_NONE),
CFG_STR("bar_position", "top", CFGF_NONE),
CFG_BOOL("raisefocus", cfg_false, CFGF_NONE),
CFG_BOOL("raiseswitch", cfg_true, CFGF_NONE),
CFG_INT("border_height", 1, CFGF_NONE),
CFG_INT("titlebar_height", 0, CFGF_NONE),
CFG_INT("tag_border_width", 0, CFGF_NONE),
CFG_END()
};
@ -181,7 +181,7 @@ init_conf(void)
CFG_STR("bar_fg", "#6289A1", CFGF_NONE),
CFG_STR("tag_sel_fg", "#FFFFFF", CFGF_NONE),
CFG_STR("tag_sel_bg", "#354B5C", CFGF_NONE),
CFG_STR("tag_separation", "#090909", CFGF_NONE),
CFG_STR("tag_border", "#090909", CFGF_NONE),
CFG_STR("layout_fg", "#FFFFFF", CFGF_NONE),
CFG_STR("layout_bg", "#292929", CFGF_NONE),
CFG_STR("titlebar_text_focus", "#FFFFFF", CFGF_NONE),
@ -341,7 +341,7 @@ init_conf(void)
conf.raiseswitch = cfg_getbool(cfg_misc, "raiseswitch");
conf.borderheight = cfg_getint(cfg_misc, "border_height");
conf.ttbarheight = cfg_getint(cfg_misc, "titlebar_height");
conf.tagsepwidth = cfg_getint(cfg_misc, "tag_separation_width");
conf.tagbordwidth = cfg_getint(cfg_misc, "tag_border_width");
conf.bartop = (strcmp(strdup(cfg_getstr(cfg_misc, "bar_position")), "top") == 0) ? True : False;
/* font */
@ -357,7 +357,7 @@ init_conf(void)
conf.colors.text = getcolor(var_to_str(cfg_getstr(cfg_colors, "bar_fg")));
conf.colors.tagselfg = getcolor(var_to_str(cfg_getstr(cfg_colors, "tag_sel_fg")));
conf.colors.tagselbg = getcolor(var_to_str(cfg_getstr(cfg_colors, "tag_sel_bg")));
conf.colors.tagsep = getcolor(var_to_str(cfg_getstr(cfg_colors, "tag_separation")));
conf.colors.tagbord = getcolor(var_to_str(cfg_getstr(cfg_colors, "tag_border")));
conf.colors.layout_fg = getcolor(var_to_str(cfg_getstr(cfg_colors, "layout_fg")));
conf.colors.layout_bg = getcolor(var_to_str(cfg_getstr(cfg_colors, "layout_bg")));
conf.colors.ttbar_text_focus = getcolor(var_to_str(cfg_getstr(cfg_colors, "titlebar_text_focus")));
@ -418,6 +418,8 @@ init_conf(void)
for(i = 0; i < conf.ntag; ++i)
{
cfgtmp = cfg_getnsec(cfg_tags, "tag", i);
if(strlen(strdup(cfg_getstr(cfgtmp, "name"))) > 256)
fprintf(stderr, "WMFS Configuration: name of tag %d too long !\n", i);
conf.tag[i].name = strdup(cfg_getstr(cfgtmp, "name"));
conf.tag[i].mwfact = cfg_getfloat(cfgtmp, "mwfact");
conf.tag[i].nmaster = cfg_getint(cfgtmp, "nmaster");

16
wmfs.c
View File

@ -354,7 +354,8 @@ init(void)
/* INIT FONT */
/* make the font string with
* the configuration information */
sprintf(fontbuf, "*-%s-%s-*-%d-*",
sprintf(fontbuf, "-*-%s-%s-*-%d-*",
conf.font.face,
conf.font.style,
conf.font.size);
@ -958,12 +959,19 @@ updatebar(void)
((i+1 == seltag) ? conf.colors.tagselfg : conf.colors.text),
((i+1 == seltag) ? conf.colors.tagselbg : conf.colors.bar), sp, -sp, buf[i]);
/* Tags line separation */
XSetForeground(dpy, gc, conf.colors.tagsep);
/* Tags border separation */
XSetForeground(dpy, gc, conf.colors.tagbord);
if(i > 0)
XFillRectangle(dpy, dr, gc, taglen[i]-sp, 0, conf.tagsepwidth, barheight);
XFillRectangle(dpy, dr, gc, taglen[i]-sp, 0, conf.tagbordwidth, barheight);
}
/* Under tag border */
if(conf.tagbordwidth)
XFillRectangle(dpy, dr, gc, 0,
((conf.bartop) ? barheight-1: 0),
taglen[conf.ntag],
1);
/* Layout symbol */
xprint(dr, taglen[conf.ntag] - sp/2 - 1, fonth,
conf.colors.layout_fg, conf.colors.layout_bg,

4
wmfs.h
View File

@ -139,7 +139,7 @@ typedef struct
bool bartop;
int borderheight;
int ttbarheight;
int tagsepwidth;
int tagbordwidth;
struct
{
char *face;
@ -155,7 +155,7 @@ typedef struct
uint text;
uint tagselfg;
uint tagselbg;
uint tagsep;
uint tagbord;
uint layout_fg;
uint layout_bg;
uint ttbar_text_focus;

4
wmfsrc
View File

@ -12,7 +12,7 @@ misc
raiseswitch = true
border_height = 1
titlebar_height = 12
tag_separation_width = 0
tag_border_width = 0
}
font
@ -38,7 +38,7 @@ colors
#Tag
tag_sel_fg = "#191919"
tag_sel_bg = "#7E89A2"
tag_separation = "#191919"
tag_border = "#191919"
#Layout
layout_fg = "#191919"