Re-implemented "View_setLayout"

... allowing to set absolute and relative values
This commit is contained in:
joten 2015-01-27 22:13:03 +01:00
parent 2346f3734e
commit 9a539e10af
3 changed files with 13 additions and 14 deletions

View file

@ -105,8 +105,9 @@ two log messages (`Manager_logViewWindowList` and
### Layout management
`#Tab::View_setLayout(-1)`
> Set the previously set layout. You may also use `View_setLayout(>)` for
setting the next layout in the layout array.
> Set the previously set layout. You may also use `View_setLayout(0, +1)` for
setting the next or `View_setLayout(0, -1)` for setting the previous layout in
the layout array.
`#f::View_setLayout(3)`
> Set the 3<sup><small>rd</small></sup> defined layout (i. e. floating layout

View file

@ -318,7 +318,7 @@ Bar_GuiContextMenu:
{
If Not (SubStr(A_GuiControl, 6, InStr(A_GuiControl, "_#", False, 0) - 6) = Manager_aMonitor)
Manager_activateMonitor(SubStr(A_GuiControl, 6, InStr(A_GuiControl, "_#", False, 0) - 6) - Manager_aMonitor)
View_setLayout(">")
View_setLayout(0, +1)
}
Else If (SubStr(A_GuiControl, -4) = "_view")
{

View file

@ -225,21 +225,19 @@ View_setGapWidth(d)
}
}
View_setLayout(l)
{
View_setLayout(i, d = 0) {
Local v
v := Monitor_#%Manager_aMonitor%_aView_#1
If (l = -1)
l := View_#%Manager_aMonitor%_#%v%_layout_#2
If (l = ">")
l := Manager_loop(View_#%Manager_aMonitor%_#%v%_layout_#1, +1, 1, Config_layoutCount)
If (l > 0) And (l <= Config_layoutCount)
{
If Not (l = View_#%Manager_aMonitor%_#%v%_layout_#1)
{
If (i = -1)
i := View_#%Manager_aMonitor%_#%v%_layout_#2
Else If (i = 0)
i := View_#%Manager_aMonitor%_#%v%_layout_#1
i := Manager_loop(i, d, 1, Config_layoutCount)
If (i > 0) And (i <= Config_layoutCount) {
If Not (i = View_#%Manager_aMonitor%_#%v%_layout_#1) {
View_#%Manager_aMonitor%_#%v%_layout_#2 := View_#%Manager_aMonitor%_#%v%_layout_#1
View_#%Manager_aMonitor%_#%v%_layout_#1 := l
View_#%Manager_aMonitor%_#%v%_layout_#1 := i
}
View_arrange(Manager_aMonitor, v, True)
}