Revised "Manager_setViewMonitor"

... to allow setting absolute and relative values.
This commit is contained in:
joten 2015-01-28 20:49:03 +01:00
parent 0d967e02fe
commit f7d712d61c
4 changed files with 41 additions and 41 deletions

View file

@ -13,8 +13,8 @@
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`,
`Manager_activateMonitor`, `Manager_setWindowMonitor`, `Monitor_activateView`, `Monitor_setWindowTag`, `View_setLayout`,
`View_setMFactor`, `View_shuffleWindow`
`Manager_activateMonitor`, `Manager_setViewMonitor`, `Manager_setWindowMonitor`, `Monitor_activateView`, `Monitor_setWindowTag`,
`View_setLayout`, `View_setMFactor`, `View_shuffleWindow`
5. `~` Revised the interface, i. e. the parameters, of the following functions for setting absolute and relative values -- but did
not implement the functionality: `Monitor_toggleWindowTag`, `View_activateWindow`
@ -44,6 +44,8 @@ not implement the functionality: `Monitor_toggleWindowTag`, `View_activateWindow
| | | `#,::Manager_activateMonitor(-1)` | `#,::Manager_activateMonitor(0, -1)` |
| | | `#+.::Manager_setWindowMonitor(+1)` | `#+.::Manager_setWindowMonitor(0, +1)` |
| | | `#+,::Manager_setWindowMonitor(-1)` | `#+,::Manager_setWindowMonitor(0, -1)` |
| | | `#^+.::Manager_setViewMonitor(+1)` | `#^+.::Manager_setViewMonitor(0, +1)` |
| | | `#^+,::Manager_setViewMonitor(-1)` | `#^+,::Manager_setViewMonitor(0, -1)` |
| 5. | | `#Down::View_activateWindow(+1)` | `#Down::View_activateWindow(0, +1)` |
| | | `#Up::View_activateWindow(-1)` | `#Up::View_activateWindow(0, -1)` |

View file

@ -229,11 +229,14 @@ set the active window on the first monitor.
> Set the active window's view to the active view on the previous monitor in a
multi-monitor environment.
`#^+.::Manager_setViewMonitor(+1)`
`#^+.::Manager_setViewMonitor(0, +1)`
> Set all windows of the active view on the active view of the next monitor in
a multi-monitor environment.
a multi-monitor environment. You may also set all windows of the active view on
a specific monitor by using the first parameter, e. g.
`Manager_setViewMonitor(1)` will set all windows of the active view on the
first monitor.
`#^+,::Manager_setViewMonitor(-1)`
`#^+,::Manager_setViewMonitor(0, -1)`
> Set all windows of the active view on the active view of the previous monitor
in a multi-monitor environment.

View file

@ -473,8 +473,8 @@ Config_UI_saveSession() {
#,::Manager_activateMonitor(0, -1)
#+.::Manager_setWindowMonitor(0, +1)
#+,::Manager_setWindowMonitor(0, -1)
#^+.::Manager_setViewMonitor(+1)
#^+,::Manager_setViewMonitor(-1)
#^+.::Manager_setViewMonitor(0, +1)
#^+,::Manager_setViewMonitor(0, -1)
;; GUI management
#+Space::Monitor_toggleBar()

View file

@ -894,44 +894,39 @@ Manager_serCursor(wndId) {
}
}
Manager_setViewMonitor(d)
{
Local aView, aWndId, m, v, wndIds
Manager_setViewMonitor(i, d = 0) {
Local aView, aWndId, v, wndIds
If (Manager_monitorCount > 1)
{
m := Manager_loop(Manager_aMonitor, d, 1, Manager_monitorCount)
v := Monitor_#%m%_aView_#1
aView := Monitor_#%Manager_aMonitor%_aView_#1
If View_#%Manager_aMonitor%_#%aView%_wndIds
aView := Monitor_#%Manager_aMonitor%_aView_#1
If (Manager_monitorCount > 1) And View_#%Manager_aMonitor%_#%aView%_wndIds {
If (i = 0)
i := Manager_aMonitor
i := Manager_loop(i, d, 1, Manager_monitorCount)
v := Monitor_#%i%_aView_#1
View_#%i%_#%v%_wndIds := View_#%Manager_aMonitor%_#%aView%_wndIds View_#%i%_#%v%_wndIds
StringTrimRight, wndIds, View_#%Manager_aMonitor%_#%aView%_wndIds, 1
Loop, PARSE, wndIds, `;
{
View_#%m%_#%v%_wndIds := View_#%Manager_aMonitor%_#%aView%_wndIds View_#%m%_#%v%_wndIds
StringTrimRight, wndIds, View_#%Manager_aMonitor%_#%aView%_wndIds, 1
Loop, PARSE, wndIds, `;
{
Loop, % Config_viewCount
{
StringReplace, View_#%Manager_aMonitor%_#%A_Index%_wndIds, View_#%Manager_aMonitor%_#%A_Index%_wndIds, %A_LoopField%`;,
View_#%Manager_aMonitor%_#%A_Index%_aWndId := 0
}
Monitor_moveWindow(m, A_LoopField)
Window_#%A_LoopField%_tags := 1 << v - 1
}
View_arrange(Manager_aMonitor, aView)
Loop, % Config_viewCount
{
Bar_updateView(Manager_aMonitor, A_Index)
Loop, % Config_viewCount {
StringReplace, View_#%Manager_aMonitor%_#%A_Index%_wndIds, View_#%Manager_aMonitor%_#%A_Index%_wndIds, %A_LoopField%`;,
View_#%Manager_aMonitor%_#%A_Index%_aWndId := 0
}
;; Manually set the active monitor.
Manager_aMonitor := m
View_arrange(m, v)
WinGet, aWndId, ID, A
Manager_winActivate(aWndId)
Bar_updateView(m, v)
Monitor_moveWindow(i, A_LoopField)
Window_#%A_LoopField%_tags := 1 << v - 1
}
View_arrange(Manager_aMonitor, aView)
Loop, % Config_viewCount {
Bar_updateView(Manager_aMonitor, A_Index)
}
;; Manually set the active monitor.
Manager_aMonitor := i
View_arrange(i, v)
WinGet, aWndId, ID, A
Manager_winActivate(aWndId)
Bar_updateView(i, v)
}
}
@ -961,7 +956,7 @@ Manager_setWindowBorders()
}
}
Manager_setWindowMonitor(i, d) {
Manager_setWindowMonitor(i, d = 0) {
Local aWndId, v
WinGet, aWndId, ID, A