Added a function regarding #151

... resetting the tile layout properties of the current view
This commit is contained in:
joten 2018-01-28 15:49:19 +01:00
parent 09323f4de9
commit 8a47340da9
5 changed files with 43 additions and 1 deletions

View file

@ -6,6 +6,14 @@
* `~` changed
* `+` added
### 9.0.2
1. `+` Added a function and corresponding hotkey to reset the tile layout of the current view.
| # | `-` or `~` Configuration Variables or <br/> `-` Hotkey Functions | `+` Configuration Variables or <br/> `+` Hotkey Functions |
| --:| ---------------------------------------------------------------- | --------------------------------------------------------- |
| 1. | | `#^Backspace::View_resetTileLayout()` |
### 9.0.1
1. `+` Added a cheat sheet for the default hotkeys.

View file

@ -334,6 +334,14 @@ gap and `View_setLayoutProperty(GapWidth, 20, 0)` will set it to 20px.
_Increase the gap between windows_ in "monocle" and "tile" layout.
-------------------------------------------------------------------------------
`Config_hotkey=#^Backspace::View_resetTileLayout()`
_Reset the tile layout_.
> This resets the layout and tile layout properties of the currently active
view to the initial (default) values.
### View / Tag management
`Config_hotkey=#+n::View_toggleMargins()`

View file

@ -11,7 +11,7 @@ keys, which can be used for non-bug.n hotkeys or to reassign bug.n functions.
| Up | x | x | x | | x | |
| Left | x | x | x | | | |
| Right | x | x | x | | | |
| Backspace | x | | | | x | |
| Backspace | x | | x | | x | |
| Enter | | x | x | | | x |
| Space | x | x | | | | |
| Tab | x | | x | x | | |

View file

@ -465,6 +465,7 @@ Config_UI_saveSession() {
#^Left::View_setLayoutProperty("MX", 0, -1)
#+Left::View_setLayoutProperty("GapWidth", 0, -2)
#+Right::View_setLayoutProperty("GapWidth", 0, +2)
#^Backspace::View_resetTileLayout()
;; View/Tag management
#+n::View_toggleMargins()

View file

@ -250,6 +250,31 @@ View_moveWindow(i=0, d=0) {
}
}
View_resetTileLayout() {
Local m, v
m := Manager_aMonitor
v := Monitor_#%m%_aView_#1
View_#%m%_#%v%_area_#0 := 0
View_#%m%_#%v%_layout_#2 := View_#%m%_#%v%_layout_#1
View_#%m%_#%v%_layout_#1 := 1
View_#%m%_#%v%_layoutAxis_#1 := Config_layoutAxis_#1
View_#%m%_#%v%_layoutAxis_#2 := Config_layoutAxis_#2
View_#%m%_#%v%_layoutAxis_#3 := Config_layoutAxis_#3
View_#%m%_#%v%_layoutGapWidth := Config_layoutGapWidth
View_#%m%_#%v%_layoutMFact := Config_layoutMFactor
View_#%m%_#%v%_layoutMX := 1
View_#%m%_#%v%_layoutMY := 1
View_#%m%_#%v%_layoutSymbol := Config_layoutSymbol_#1
View_#%m%_#%v%_margins := "0;0;0;0"
View_#%m%_#%v%_showStackArea := True
StringSplit, View_#%m%_#%v%_margin, View_#%m%_#%v%_margins, `;
If Tiler_isActive(m, v)
View_arrange(m, v)
}
View_setActiveWindow(m, v, wndId) {
Global