use compute_new_value_from_arg in uicb_setmwfact
This commit is contained in:
parent
4488708feb
commit
4d03dd3e53
|
@ -48,10 +48,11 @@ uicb_setnmaster(Display *disp,
|
||||||
if(!arg)
|
if(!arg)
|
||||||
nmaster = awesomeconf->nmaster;
|
nmaster = awesomeconf->nmaster;
|
||||||
else
|
else
|
||||||
|
{
|
||||||
nmaster = (int) compute_new_value_from_arg(arg, (double) nmaster);
|
nmaster = (int) compute_new_value_from_arg(arg, (double) nmaster);
|
||||||
|
|
||||||
if(nmaster < 1)
|
if(nmaster < 1)
|
||||||
nmaster = 1;
|
nmaster = 1;
|
||||||
|
}
|
||||||
|
|
||||||
if(sel)
|
if(sel)
|
||||||
arrange(disp, drawcontext, awesomeconf);
|
arrange(disp, drawcontext, awesomeconf);
|
||||||
|
@ -65,20 +66,14 @@ uicb_setmwfact(Display *disp,
|
||||||
awesome_config * awesomeconf,
|
awesome_config * awesomeconf,
|
||||||
const char *arg)
|
const char *arg)
|
||||||
{
|
{
|
||||||
double delta;
|
|
||||||
|
|
||||||
if(!IS_ARRANGE(tile) && !IS_ARRANGE(tileleft) && !IS_ARRANGE(bstack) && !IS_ARRANGE(bstackportrait))
|
if(!IS_ARRANGE(tile) && !IS_ARRANGE(tileleft) && !IS_ARRANGE(bstack) && !IS_ARRANGE(bstackportrait))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/* arg handling, manipulate mwfact */
|
|
||||||
if(!arg)
|
if(!arg)
|
||||||
mwfact = awesomeconf->mwfact;
|
mwfact = awesomeconf->mwfact;
|
||||||
else if(sscanf(arg, "%lf", &delta))
|
|
||||||
{
|
|
||||||
if(arg[0] != '+' && arg[0] != '-')
|
|
||||||
mwfact = delta;
|
|
||||||
else
|
else
|
||||||
mwfact += delta;
|
{
|
||||||
|
mwfact = compute_new_value_from_arg(arg, mwfact);
|
||||||
if(mwfact < 0.1)
|
if(mwfact < 0.1)
|
||||||
mwfact = 0.1;
|
mwfact = 0.1;
|
||||||
else if(mwfact > 0.9)
|
else if(mwfact > 0.9)
|
||||||
|
|
Loading…
Reference in New Issue