Added "GapWidth" to View_setLayoutProperty

+ minor correction
This commit is contained in:
joten 2015-01-27 21:30:10 +01:00
parent 3f8701f26f
commit f18dd93523
4 changed files with 19 additions and 16 deletions

View file

@ -10,7 +10,7 @@
1. `~` Renamed the function `Manager_toggleDecor` to `Window_toggleDecor`
2. `~` Renamed the function `View_toggleFloating` to `View_toggleFloatingWindow`
3. `~` Migrated the following functions to `View_setLayoutProperty`: `View_setMFactor`, `View_setMX`, `View_setMY` and `View_rotateLayoutAxis`
3. `~` Migrated the following functions to `View_setLayoutProperty`: `View_setGapWidth`, `View_setMFactor`, `View_setMX`, `View_setMY` and `View_rotateLayoutAxis`
| # | Configuration variables | Hotkeys |
| --:| ----------------------- | --------------------------------------------------------- |
@ -38,6 +38,10 @@
| | | `+` `#^Right::View_setLayoutProperty("MX", 0, +1)` |
| | | `-` `#^Left::View_setMX(-1)` |
| | | `+` `#^Left::View_setLayoutProperty("MX", 0, -1)` |
| | | `-` `View_setGapWidth(-2)` |
| | | `+` `View_setLayoutProperty("GapWidth", 0, -2)` |
| | | `-` `View_setGapWidth(+2)` |
| | | `+` `View_setLayoutProperty("GapWidth", 0, +2)` |
### 8.4.0

View file

@ -166,11 +166,11 @@ the master area by Y. Maximum of 9 (only for the "tile" layout).
> Decrease the master X dimension by 1, i. e. decrease the number of windows in
the master area by Y. Minimum of 1 (only for the "tile" layout).
`#+Left::View_setGapWidth(-2)`
> Decrease the gap between windows in "tile" layout.
`#+Left::View_setLayoutProperty("GapWidth", 0, -2)`
> Decrease the gap between windows in "monocle" and "tile" layout.
`#+Right::View_setGapWidth(+2)`
> Increase the gap between windows in "tile" layout.
`#+Right::View_setLayoutProperty("GapWidth", 0, +2)`
> Increase the gap between windows in "monocle" and "tile" layout.
### View / Tag management

View file

@ -433,8 +433,8 @@ Config_UI_saveSession() {
#^Down::View_setLayoutProperty("MY", 0, -1)
#^Right::View_setLayoutProperty("MX", 0, +1)
#^Left::View_setLayoutProperty("MX", 0, -1)
#+Left::View_setGapWidth(-2)
#+Right::View_setGapWidth(+2)
#+Left::View_setLayoutProperty("GapWidth", 0, -2)
#+Right::View_setLayoutProperty("GapWidth", 0, +2)
;; View/Tag management
#+n::View_toggleMargins()

View file

@ -245,24 +245,23 @@ View_setLayout(l)
}
}
View_setLayoutProperty(name, i, d, opt = -1) {
View_setLayoutProperty(name, i, d, opt = 0) {
Local a, v
v := Monitor_#%Manager_aMonitor%_aView_#1
If Tiler_isActive(Manager_aMonitor, v) {
If (name = "MFactor") {
If (opt = -1)
If (name = "Axis")
a := Tiler_setAxis(Manager_aMonitor, v, opt, d)
Else If (name = "MFactor") {
If (opt = 0)
opt := 1
a := Tiler_setMFactor(Manager_aMonitor, v, d, opt)
} Else If (name = "MX")
} Else If (name = "GapWidth")
View_setGapWidth(d)
Else If (name = "MX")
a := Tiler_setMX(Manager_aMonitor, v, d)
Else If (name = "MY")
a := Tiler_setMY(Manager_aMonitor, v, d)
Else If (name = "Axis") {
If (opt = -1)
opt := 0
a := Tiler_setAxis(Manager_aMonitor, v, opt, d)
}
If a
View_arrange(Manager_aMonitor, v)