From 2346f3734e7ecd92bd97d46863b05c80101a2aed Mon Sep 17 00:00:00 2001 From: joten Date: Tue, 27 Jan 2015 21:59:12 +0100 Subject: [PATCH] Implemented setting mfact to an absolute value --- doc/Default_hotkeys.md | 21 +++++++++++++-------- src/Tiler.ahk | 14 ++++++-------- src/View.ahk | 2 +- 3 files changed, 20 insertions(+), 17 deletions(-) diff --git a/doc/Default_hotkeys.md b/doc/Default_hotkeys.md index a00a9fd..321b6f0 100644 --- a/doc/Default_hotkeys.md +++ b/doc/Default_hotkeys.md @@ -122,17 +122,22 @@ the default configuration). `#Left::View_setLayoutProperty("MFactor", 0, -0.05)` > Reduce the size of the master area in the active view (only for the "tile" -layout). You may also set a second parameter for accelerating the first one. -E. g. with `#Left::View_setLayoutProperty("MFactor", 0, -0.05, 2)` the first -step, by which the master area is reduced, is -0.0016% and will be doubled with -consecutive calls until it reaches -0.05%. +layout). You may also set an additional parameter for accelerating the third +one. E. g. with `#Left::View_setLayoutProperty("MFactor", 0, -0.05, 2)` the +first step, by which the master area is reduced, is -0.0016% and will be +doubled with consecutive calls until it reaches -0.05%. +With the second parameter you may set an absolute value, e. g. +'View_setLayoutProperty("MFactor", 0.5, 0)' splits the view in half. `#Right::View_setLayoutProperty("MFactor", 0, +0.05)` > Enlarge the size of the master area in the active view (only for the "tile" -layout). You may also set a second parameter for accelerating the first one. -E. g. with `#Right::View_setLayoutProperty("MFactor", 0, +0.05, 0.5)` the first -step, by which the master area is reduced, is 0.05%, but with consecutive calls -it will be halved until it reaches 0.0016%. +layout). You may also set a additional parameter for accelerating the third +one. E. g. with `#Right::View_setLayoutProperty("MFactor", 0, +0.05, 0.5)` the +first step, by which the master area is reduced, is 0.05%, but with consecutive +calls it will be halved until it reaches 0.0016%. +With the second parameter you may set an absolute value, e. g. +'View_setLayoutProperty("MFactor", 0.67, 0)' makes the master area two thirds +and the stacking area one third the size of the view. `#^t::View_setLayoutProperty("Axis", 0, +1, 1)` > Rotate the layout axis (i. e. 2 -> 1 = vertical layout, 1 -> 2 = horizontal diff --git a/src/Tiler.ahk b/src/Tiler.ahk index e837b4f..61982fd 100644 --- a/src/Tiler.ahk +++ b/src/Tiler.ahk @@ -216,16 +216,14 @@ Tiler_setAxis(m, v, id, d) { Return, 0 } -Tiler_setMFactor(m, v, d, dFact) { +Tiler_setMFactor(m, v, i, d, dFact) { Local mFact - mFact := 0 - If (d > 1) - mFact := d - Else { - d := Tiler_getMFactorD(m, v, d, dFact) - mFact := View_#%m%_#%v%_layoutMFact + d - } + If (i > 0) + mFact := i + Else + mFact := View_#%m%_#%v%_layoutMFact + mFact += Tiler_getMFactorD(m, v, d, dFact) If (mFact > 0 And mFact < 1) { View_#%m%_#%v%_layoutMFact := mFact Return, 1 diff --git a/src/View.ahk b/src/View.ahk index e9cd828..ff7b1e3 100644 --- a/src/View.ahk +++ b/src/View.ahk @@ -255,7 +255,7 @@ View_setLayoutProperty(name, i, d, opt = 0) { Else If (name = "MFactor") { If (opt = 0) opt := 1 - a := Tiler_setMFactor(Manager_aMonitor, v, d, opt) + a := Tiler_setMFactor(Manager_aMonitor, v, i, d, opt) } Else If (name = "GapWidth") View_setGapWidth(d) Else If (name = "MX")