Revised "Monitor_setWindowTag"

... to allow setting absolute and relative values.
This commit is contained in:
joten 2015-01-28 18:11:47 +01:00
parent 05d75e876c
commit b014a72284
4 changed files with 51 additions and 78 deletions

View file

@ -10,49 +10,33 @@
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_setGapWidth`, `View_setMFactor`, `View_setMX`, `View_setMY` and `View_rotateLayoutAxis`
4. `~` Revised the following functions to allow setting absolute and relative values: `Debug_setLogLevel`, `Monitor_activateView`, `View_setLayout`, `View_setMFactor`, `View_shuffleWindow`
3. `~` Migrated the following functions to `View_setLayoutProperty`: `View_setGapWidth`, `View_setMFactor`, `View_setMX`,
`View_setMY` and `View_rotateLayoutAxis`
4. `~` Revised the following functions to allow setting absolute and relative values: `Debug_setLogLevel`, `Monitor_activateView`,
`Monitor_setWindowTag`, `View_setLayout`, `View_setMFactor`, `View_shuffleWindow`
| # | Configuration variables | Hotkeys |
| --:| ----------------------- | --------------------------------------------------------- |
| 1. | | `-` `#+d::Manager_toggleDecor()` |
| | | `+` `#+d::Window_toggleDecor()` |
| 2. | | `-` `#+f::View_toggleFloating()` |
| | | `+` `#+f::View_toggleFloatingWindow()` |
| 3. | | `-` `#Left::View_setMFactor(-0.05)` |
| | | `+` `#Left::View_setLayoutProperty("MFactor", 0, -0.05)` |
| | | `-` `#Right::View_setMFactor(+0.05)` |
| | | `+` `#Right::View_setLayoutProperty("MFactor", 0, +0.05)` |
| | | `-` `#^t::View_rotateLayoutAxis(1, +1)` |
| | | `+` `#^t::View_setLayoutProperty("Axis", 0, +1, 1)` |
| | | `-` `#^Enter::View_rotateLayoutAxis(1, +2)` |
| | | `+` `#^Enter::View_setLayoutProperty("Axis", 0, +2, 1)` |
| | | `-` `#^Tab::View_rotateLayoutAxis(2, +1)` |
| | | `+` `#^Tab::View_setLayoutProperty("Axis", 0, +1, 2)` |
| | | `-` `#^+Tab::View_rotateLayoutAxis(3, +1)` |
| | | `+` `#^+Tab::View_setLayoutProperty("Axis", 0, +1, 3)` |
| | | `-` `#^Up::View_setMY(+1)` |
| | | `+` `#^Up::View_setLayoutProperty("MY", 0, +1)` |
| | | `-` `#^Down::View_setMY(-1)` |
| | | `+` `#^Down::View_setLayoutProperty("MY", 0, -1)` |
| | | `-` `#^Right::View_setMX(+1)` |
| | | `+` `#^Right::View_setLayoutProperty("MX", 0, +1)` |
| | | `-` `#^Left::View_setMX(-1)` |
| | | `+` `#^Left::View_setLayoutProperty("MX", 0, -1)` |
| | | `-` `#+Left::View_setGapWidth(-2)` |
| | | `+` `#+Left::View_setLayoutProperty("GapWidth", 0, -2)` |
| | | `-` `#+Right::View_setGapWidth(+2)` |
| | | `+` `#+Right::View_setLayoutProperty("GapWidth", 0, +2)` |
| 4. | | `-` `#^d::Debug_setLogLevel(-1)` |
| | | `+` `#^d::Debug_setLogLevel(0, -1)` |
| | | `-` `#^+d::Debug_setLogLevel(+1)` |
| | | `+` `#^+d::Debug_setLogLevel(0, +1)` |
| | | `-` `#+Down::View_shuffleWindow(+1)` |
| | | `+` `#+Down::View_shuffleWindow(0, +1)` |
| | | `-` `#+Up::View_shuffleWindow(-1)` |
| | | `+` `#+Up::View_shuffleWindow(0, -1)` |
| | | `-` `#+Enter::View_shuffleWindow(0)` |
| | | `+` `#+Enter::View_shuffleWindow(1)` |
| # | Configuration variables | `-` Hotkey functions | `+` Hotkey functions |
| --:| ----------------------- | --------------------------------------- | ----------------------------------------------------- |
| 1. | | `#+d::Manager_toggleDecor()` | `#+d::Window_toggleDecor()` |
| 2. | | `#+f::View_toggleFloating()` | `#+f::View_toggleFloatingWindow()` |
| 3. | | `#Left::View_setMFactor(-0.05)` | `#Left::View_setLayoutProperty("MFactor", 0, -0.05)` |
| | | `#Right::View_setMFactor(+0.05)` | `#Right::View_setLayoutProperty("MFactor", 0, +0.05)` |
| | | `#^t::View_rotateLayoutAxis(1, +1)` | `#^t::View_setLayoutProperty("Axis", 0, +1, 1)` |
| | | `#^Enter::View_rotateLayoutAxis(1, +2)` | `#^Enter::View_setLayoutProperty("Axis", 0, +2, 1)` |
| | | `#^Tab::View_rotateLayoutAxis(2, +1)` | `#^Tab::View_setLayoutProperty("Axis", 0, +1, 2)` |
| | | `#^+Tab::View_rotateLayoutAxis(3, +1)` | `#^+Tab::View_setLayoutProperty("Axis", 0, +1, 3)` |
| | | `#^Up::View_setMY(+1)` | `#^Up::View_setLayoutProperty("MY", 0, +1)` |
| | | `#^Down::View_setMY(-1)` | `#^Down::View_setLayoutProperty("MY", 0, -1)` |
| | | `#^Right::View_setMX(+1)` | `#^Right::View_setLayoutProperty("MX", 0, +1)` |
| | | `#^Left::View_setMX(-1)` | `#^Left::View_setLayoutProperty("MX", 0, -1)` |
| | | `#+Left::View_setGapWidth(-2)` | `#+Left::View_setLayoutProperty("GapWidth", 0, -2)` |
| | | `#+Right::View_setGapWidth(+2)` | `#+Right::View_setLayoutProperty("GapWidth", 0, +2)` |
| 4. | | `#^d::Debug_setLogLevel(-1)` | `#^d::Debug_setLogLevel(0, -1)` |
| | | `#^+d::Debug_setLogLevel(+1)` | `#^+d::Debug_setLogLevel(0, +1)` |
| | | `#+Down::View_shuffleWindow(+1)` | `#+Down::View_shuffleWindow(0, +1)` |
| | | `#+Up::View_shuffleWindow(-1)` | `#+Up::View_shuffleWindow(0, -1)` |
| | | `#+Enter::View_shuffleWindow(0)` | `#+Enter::View_shuffleWindow(1)` |
| | | `#+0::Monitor_setWindowTag(0)` | `#+0::Monitor_setWindowTag(10)` |
### 8.4.0

View file

@ -193,10 +193,10 @@ the master area by Y. Minimum of 1 (only for the "tile" layout).
`Monitor_activateView(0, -1)` or `Monitor_activateView(0, +1)` for activating
the previous or next adjacent view.
`#+0::Monitor_setWindowTag(0)`
`#+0::Monitor_setWindowTag(10)`
> Tag the active window with all tags (n = 1..`Config_viewCount`). You may also
use `Monitor_setWindowTag(<)` or `Monitor_setWindowTag(>)` for setting the tag
of the previous or next adjacent to the current view.
use `Monitor_setWindowTag(0, -1)` or `Monitor_setWindowTag(0, +1)` for setting
the tag of the previous or next adjacent to the current view.
`#<n>::Monitor_activateView(<n>)`
> Activate the n<sup><small>th</small></sup> view (n = 1..`Config_viewCount`).

View file

@ -439,7 +439,7 @@ Config_UI_saveSession() {
;; View/Tag management
#+n::View_toggleMargins()
#BackSpace::Monitor_activateView(-1)
#+0::Monitor_setWindowTag(0)
#+0::Monitor_setWindowTag(10)
#1::Monitor_activateView(1)
#+1::Monitor_setWindowTag(1)
#^1::Monitor_toggleWindowTag(1)

View file

@ -207,65 +207,54 @@ Monitor_moveWindow(m, wndId)
Window_#%wndId%_monitor := m
}
Monitor_setWindowTag(t)
{
Monitor_setWindowTag(i, d = 0) {
Local aView, aWndId, wndId
If (t = ">")
t := Manager_loop(Monitor_#%Manager_aMonitor%_aView_#1, +1, 1, Config_viewCount)
Else If (t = "<")
t := Manager_loop(Monitor_#%Manager_aMonitor%_aView_#1, -1, 1, Config_viewCount)
If (i = 0)
i := Monitor_#%Manager_aMonitor%_aView_#1
Else If (i <= Config_viewCount)
i := Manager_loop(i, d, 1, Config_viewCount)
WinGet, aWndId, ID, A
If (InStr(Manager_managedWndIds, aWndId ";") And t >= 0 And t <= Config_viewCount)
{
If (t = 0)
{
Loop, % Config_viewCount
{
If Not (Window_#%aWndId%_tags & (1 << A_Index - 1))
{
If InStr(Manager_managedWndIds, aWndId ";") And (i > 0) And (i <= Config_viewCount Or i = 10) {
If (i = 10) {
Loop, % Config_viewCount {
If Not (Window_#%aWndId%_tags & (1 << A_Index - 1)) {
View_#%Manager_aMonitor%_#%A_Index%_wndIds := aWndId ";" View_#%Manager_aMonitor%_#%A_Index%_wndIds
View_#%Manager_aMonitor%_#%A_Index%_aWndId := aWndId
Bar_updateView(Manager_aMonitor, A_Index)
Window_#%aWndId%_tags += 1 << A_Index - 1
}
}
}
Else
{
Loop, % Config_viewCount
{
If Not (A_index = t)
{
} Else {
Loop, % Config_viewCount {
If Not (A_index = i) {
StringReplace, View_#%Manager_aMonitor%_#%A_Index%_wndIds, View_#%Manager_aMonitor%_#%A_Index%_wndIds, %aWndId%`;,
View_#%Manager_aMonitor%_#%A_Index%_aWndId := 0
Bar_updateView(Manager_aMonitor, A_Index)
}
}
If Not (Window_#%aWndId%_tags & (1 << t - 1))
View_#%Manager_aMonitor%_#%t%_wndIds := aWndId ";" View_#%Manager_aMonitor%_#%t%_wndIds
View_#%Manager_aMonitor%_#%t%_aWndId := aWndId
Window_#%aWndId%_tags := 1 << t - 1
If Not (Window_#%aWndId%_tags & (1 << i - 1))
View_#%Manager_aMonitor%_#%i%_wndIds := aWndId ";" View_#%Manager_aMonitor%_#%i%_wndIds
View_#%Manager_aMonitor%_#%i%_aWndId := aWndId
Window_#%aWndId%_tags := 1 << i - 1
aView := Monitor_#%Manager_aMonitor%_aView_#1
If Not (t = aView)
{
If Not (i = aView) {
Manager_hideShow := True
wndId := SubStr(View_#%Manager_aMonitor%_#%aView%_wndIds, 1, InStr(View_#%Manager_aMonitor%_#%aView%_wndIds, ";")-1)
wndId := SubStr(View_#%Manager_aMonitor%_#%aView%_wndIds, 1, InStr(View_#%Manager_aMonitor%_#%aView%_wndIds, ";") - 1)
Manager_winActivate(wndId)
Manager_hideShow := False
If Config_viewFollowsTagged
Monitor_activateView(t)
Else
{
Monitor_activateView(i)
Else {
Manager_hideShow := True
Window_hide(aWndId)
Manager_hideShow := False
If Config_dynamicTiling
View_arrange(Manager_aMonitor, aView)
Bar_updateView(Manager_aMonitor, t)
Bar_updateView(Manager_aMonitor, i)
}
}
}