ncol is now configurable per tag
This commit is contained in:
parent
59f377526f
commit
ceb6cc797a
|
@ -39,6 +39,7 @@ screen 0
|
|||
}
|
||||
tag 3
|
||||
{
|
||||
ncol = 2
|
||||
layout = "tile"
|
||||
}
|
||||
tag 4
|
||||
|
@ -71,7 +72,6 @@ screen 0
|
|||
|
||||
layouts
|
||||
{
|
||||
ncol = 1
|
||||
layout tile
|
||||
{
|
||||
symbol = "[]="
|
||||
|
|
5
config.c
5
config.c
|
@ -177,6 +177,7 @@ parse_config(const char *confpatharg, awesome_config *awesomeconf)
|
|||
CFG_STR((char *) "layout", (char *) "tile", CFGF_NONE),
|
||||
CFG_FLOAT((char *) "mwfact", 0.5, CFGF_NONE),
|
||||
CFG_INT((char *) "nmaster", 1, CFGF_NONE),
|
||||
CFG_INT((char *) "ncol", 1, CFGF_NONE),
|
||||
CFG_END()
|
||||
};
|
||||
static cfg_opt_t tags_opts[] =
|
||||
|
@ -192,7 +193,6 @@ parse_config(const char *confpatharg, awesome_config *awesomeconf)
|
|||
static cfg_opt_t layouts_opts[] =
|
||||
{
|
||||
CFG_SEC((char *) "layout", layout_opts, CFGF_TITLE | CFGF_MULTI),
|
||||
CFG_INT((char *) "ncol", 1, CFGF_NONE),
|
||||
CFG_END()
|
||||
};
|
||||
static cfg_opt_t screen_opts[] =
|
||||
|
@ -337,8 +337,6 @@ parse_config(const char *confpatharg, awesome_config *awesomeconf)
|
|||
awesomeconf->layouts[i].symbol = a_strdup(cfg_getstr(cfgsectmp, "symbol"));
|
||||
}
|
||||
|
||||
awesomeconf->ncol = cfg_getint(cfg_layouts, "ncol");
|
||||
|
||||
if(!awesomeconf->nlayouts)
|
||||
eprint("awesome: fatal: no default layout available\n");
|
||||
|
||||
|
@ -377,6 +375,7 @@ parse_config(const char *confpatharg, awesome_config *awesomeconf)
|
|||
awesomeconf->tags[i].layout = &awesomeconf->layouts[k];
|
||||
awesomeconf->tags[i].mwfact = cfg_getfloat(cfgsectmp, "mwfact");
|
||||
awesomeconf->tags[i].nmaster = cfg_getint(cfgsectmp, "nmaster");
|
||||
awesomeconf->tags[i].ncol = cfg_getint(cfgsectmp, "ncol");
|
||||
}
|
||||
|
||||
|
||||
|
|
4
config.h
4
config.h
|
@ -136,6 +136,8 @@ typedef struct
|
|||
double mwfact;
|
||||
/** Number of master windows */
|
||||
int nmaster;
|
||||
/** Number of columns in tile layout */
|
||||
int ncol;
|
||||
} Tag;
|
||||
|
||||
/** Main configuration structure */
|
||||
|
@ -171,8 +173,6 @@ struct awesome_config
|
|||
int borderpx;
|
||||
/** Number of pixels to snap windows */
|
||||
int snap;
|
||||
/** Number of columns in tile layout */
|
||||
int ncol;
|
||||
/** Transparency of unfocused clients */
|
||||
int opacity_unfocused;
|
||||
/** Focus move pointer */
|
||||
|
|
|
@ -48,13 +48,14 @@ void
|
|||
uicb_setncol(awesome_config *awesomeconf,
|
||||
const char * arg)
|
||||
{
|
||||
Layout *curlay = get_current_layout(awesomeconf->tags, awesomeconf->ntags);
|
||||
Tag *curtag = get_current_tag(awesomeconf->tags, awesomeconf->ntags);
|
||||
Layout *curlay = curtag->layout;
|
||||
|
||||
if(!arg || (curlay->arrange != layout_tile && curlay->arrange != layout_tileleft))
|
||||
return;
|
||||
|
||||
if((awesomeconf->ncol = (int) compute_new_value_from_arg(arg, (double) awesomeconf->ncol)) < 1)
|
||||
awesomeconf->ncol = 1;
|
||||
if((curtag->ncol = (int) compute_new_value_from_arg(arg, (double) curtag->ncol)) < 1)
|
||||
curtag->ncol = 1;
|
||||
|
||||
arrange(awesomeconf);
|
||||
}
|
||||
|
@ -129,7 +130,7 @@ _tile(awesome_config *awesomeconf, const Bool right)
|
|||
else
|
||||
mh = mw = 0;
|
||||
|
||||
real_ncol = MIN(otherwin, awesomeconf->ncol);
|
||||
real_ncol = MIN(otherwin, curtag->ncol);
|
||||
|
||||
for(i = 0, c = *awesomeconf->clients; c; c = c->next)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue