Conf: Add misc { pad = x }.

This commit is contained in:
Martin Duquesnoy 2009-06-18 21:57:15 +02:00
parent eb4f98ac54
commit 59f203ee8f
5 changed files with 16 additions and 3 deletions

View File

@ -129,6 +129,16 @@ conf_misc_section(cfg_t *cfg_m)
conf.raisefocus = cfg_getbool(cfg_m, "raisefocus");
conf.raiseswitch = cfg_getbool(cfg_m, "raiseswitch");
if(cfg_getint(cfg_m, "pad") > 24 || cfg_getint(cfg_m, "pad") < 1)
{
fprintf(stderr, "WMFS Configuration: pad value (%ld) incorrect.\n",
cfg_getint(cfg_m, "pad"));
conf.pad = 12;
}
else
conf.pad = cfg_getint(cfg_m, "pad");
return;
}

View File

@ -40,6 +40,7 @@ char final_path[128];
cfg_opt_t misc_opts[] =
{
CFG_STR("font", "sans-9", CFGF_NONE),
CFG_INT("pad", 12, CFGF_NONE),
CFG_BOOL("raisefocus", cfg_false, CFGF_NONE),
CFG_BOOL("raiseswitch", cfg_true, CFGF_NONE),
CFG_END()

View File

@ -279,6 +279,7 @@ typedef struct
char *font;
Bool raisefocus;
Bool raiseswitch;
uint pad;
struct
{
/*

View File

@ -75,8 +75,8 @@
#define ATOM(a) XInternAtom(dpy, (a), False)
#define INFOBARH ((conf.bars.height > 0) ? conf.bars.height : (font->height * 1.5))
#define FHINFOBAR ((font->height - font->descent) + (INFOBARH - font->height) / 2)
#define SHADH 1
#define SHADC 0x000000 /* 'Cause i don't know how darken a color yet */
#define SHADH (1)
#define SHADC (0x000000) /* 'Cause i don't know how darken a color yet */
#define BORDH conf.client.borderheight
#define TBARH ((conf.titlebar.height < BORDH) ? BORDH : conf.titlebar.height)
#define FRAMEW(w) ((w) + BORDH * 2)
@ -88,7 +88,7 @@
#define IFREE(x) if(x) free(x)
#define LEN(x) (sizeof(x) / sizeof((x)[0]))
#define deb(p) fprintf(stderr, "debug: %d\n", (p))
#define PAD (14)
#define PAD conf.pad
/* barwin.c */
BarWindow *barwin_create(Window parent,

View File

@ -13,6 +13,7 @@ misc
font = "dejavu-10"
raisefocus = false
raiseswitch = true
pad = 12
}
bar