From f18dd935236906a9452fc68234f479882cb6b1bc Mon Sep 17 00:00:00 2001 From: joten Date: Tue, 27 Jan 2015 21:30:10 +0100 Subject: [PATCH] Added "GapWidth" to View_setLayoutProperty + minor correction --- doc/CHANGES.md | 6 +++++- doc/Default_hotkeys.md | 8 ++++---- src/Config.ahk | 4 ++-- src/View.ahk | 17 ++++++++--------- 4 files changed, 19 insertions(+), 16 deletions(-) diff --git a/doc/CHANGES.md b/doc/CHANGES.md index 1751e78..74bc8b1 100644 --- a/doc/CHANGES.md +++ b/doc/CHANGES.md @@ -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 diff --git a/doc/Default_hotkeys.md b/doc/Default_hotkeys.md index 940b1c9..a00a9fd 100644 --- a/doc/Default_hotkeys.md +++ b/doc/Default_hotkeys.md @@ -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 diff --git a/src/Config.ahk b/src/Config.ahk index e912606..295143c 100644 --- a/src/Config.ahk +++ b/src/Config.ahk @@ -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() diff --git a/src/View.ahk b/src/View.ahk index 89d54c7..e9cd828 100644 --- a/src/View.ahk +++ b/src/View.ahk @@ -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)