infobar: Add option to set the borders around the tag buttons, the layout button and the infobar.

This commit is contained in:
Martin Duquesnoy
2009-01-18 03:25:10 +01:00
parent d789c6d0f2
commit 796c7988d6
7 changed files with 79 additions and 11 deletions

View File

@@ -131,6 +131,7 @@ conf_misc_section(cfg_t *cfg_m)
void
conf_bar_section(cfg_t *cfg_b)
{
conf.border.bar = cfg_getbool(cfg_b, "border");
conf.colors.bar = getcolor(alias_to_str(cfg_getstr(cfg_b, "bg")));
conf.colors.text = strdup(alias_to_str(cfg_getstr(cfg_b, "fg")));
conf.bartop = (strcmp(strdup(cfg_getstr(cfg_b, "position")), "top") == 0) ? True : False;
@@ -189,6 +190,7 @@ conf_layout_section(cfg_t *cfg_l)
conf.layout[i].func = NULL;
}
conf.border.layout = cfg_getbool(cfg_l, "border");
conf.colors.layout_fg = strdup(alias_to_str(cfg_getstr(cfg_l, "fg")));
conf.colors.layout_bg = getcolor(alias_to_str(cfg_getstr(cfg_l, "bg")));
@@ -237,7 +239,7 @@ conf_tag_section(cfg_t *cfg_t)
conf.colors.tagselfg = strdup(alias_to_str(cfg_getstr(cfg_t, "sel_fg")));
conf.colors.tagselbg = getcolor(alias_to_str(cfg_getstr(cfg_t, "sel_bg")));
conf.colors.tag_occupied_bg = getcolor(alias_to_str(cfg_getstr(cfg_t, "occupied_bg")));
conf.colors.tagbord = getcolor(alias_to_str(cfg_getstr(cfg_t, "border")));
conf.border.tag = cfg_getbool(cfg_t, "border");
/* Alloc all */
conf.ntag = emalloc(screen_count(), sizeof(int));

View File

@@ -50,6 +50,7 @@ cfg_opt_t bar_opts[] =
CFG_STR("bg", "#090909", CFGF_NONE),
CFG_STR("fg", "#6289A1", CFGF_NONE),
CFG_STR("position", "top", CFGF_NONE),
CFG_BOOL("border", cfg_false, CFGF_NONE),
CFG_END()
};
@@ -105,6 +106,7 @@ cfg_opt_t layouts_opts[] =
{
CFG_STR("fg", "#FFFFFF", CFGF_NONE),
CFG_STR("bg", "#292929", CFGF_NONE),
CFG_BOOL("border", cfg_false, CFGF_NONE),
CFG_SEC("layout", layout_opts, CFGF_MULTI),
CFG_END()
};
@@ -127,7 +129,7 @@ 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),
CFG_BOOL("border", cfg_false, CFGF_NONE),
CFG_SEC("tag", tag_opts, CFGF_MULTI),
CFG_END()
};

View File

@@ -53,7 +53,7 @@ infobar_init(void)
/* Create infobar barwindow */
infobar[sc].bar = barwin_create(ROOT, sgeo[sc].x - BORDH, infobar[sc].geo.y,
sgeo[sc].width, infobar[sc].geo.height,
conf.colors.bar, conf.colors.text, False, False, True);
conf.colors.bar, conf.colors.text, False, False, conf.border.bar);
/* Create tags window */
for(i = 1; i < conf.ntag[sc] + 1; ++i)
@@ -61,7 +61,7 @@ infobar_init(void)
infobar[sc].tags[i] = barwin_create(infobar[sc].bar->win, j, 0,
textw(tags[sc][i].name) + PAD,
infobar[sc].geo.height,
conf.colors.bar, conf.colors.text, False, False, True);
conf.colors.bar, conf.colors.text, False, False, conf.border.tag);
j += textw(tags[sc][i].name) + PAD;
barwin_map_subwin(infobar[sc].tags[i]);
}
@@ -71,7 +71,7 @@ infobar_init(void)
textw(tags[sc][seltag[sc]].layout.symbol) + PAD,
infobar[sc].geo.height,
conf.colors.layout_bg, conf.colors.layout_fg,
False, False, True);
False, False, conf.border.layout);
/* Map/Refresh all */
barwin_map(infobar[sc].bar);

View File

@@ -257,6 +257,12 @@ typedef struct
MouseBinding *mouse;
int nmouse;
} titlebar;
struct
{
Bool bar;
Bool tag;
Bool layout;
} border;
Alias alias[256];
Layout layout[NUM_OF_LAYOUT];
int *ntag;