Revised Bar_toggleCommandGui() ...

... fixing positioning issues with more than one monitor possibly fixing
issue #41
This commit is contained in:
joten 2016-01-04 20:58:51 +01:00
parent 80b6b8163c
commit 4cde06aae5

View file

@ -335,25 +335,27 @@ Bar_move(m)
WinMove, %wndTitle%, , %x%, %y%
}
Bar_toggleCommandGui()
{
Bar_toggleCommandGui() {
Local wndId, x, y
Gui, 99: Default
If Bar_cmdGuiIsVisible
{
If Bar_cmdGuiIsVisible {
Bar_cmdGuiIsVisible := False
Gui, Cancel
Manager_winActivate(Bar_aWndId)
}
Else
{
} Else {
Bar_cmdGuiIsVisible := True
x := Monitor_#%Manager_aMonitor%_x + Monitor_#%Manager_aMonitor%_barX + Monitor_#%Manager_aMonitor%_barWidth - Bar_#0_#0W
If (Config_verticalBarPos = "top") Or (Config_verticalBarPos = "tray") And (Monitor_%Manager_aMonitor%_taskBarPos = "top" Or Not Monitor_#%Manager_aMonitor%_taskBarClass)
If (Config_verticalBarPos = "tray")
x := Monitor_#%Manager_aMonitor%_x + Monitor_#%Manager_aMonitor%_barX + Monitor_#%Manager_aMonitor%_barWidth - Bar_#0_#0W
Else
x := Monitor_#%Manager_aMonitor%_barX + Monitor_#%Manager_aMonitor%_barWidth - Bar_#0_#0W ;; x := mX + (mBarX - mX) + mBarW - w
If (Config_verticalBarPos = "top") Or (Config_verticalBarPos = "tray") And (Monitor_#%Manager_aMonitor%_taskBarPos = "top" Or Not Monitor_#%Manager_aMonitor%_taskBarClass)
y := Monitor_#%Manager_aMonitor%_y
Else
y := Monitor_#%Manager_aMonitor%_y + Monitor_#%Manager_aMonitor%_height - Bar_#0_#0H
Gui, Show
WinGet, wndId, ID, bug.n_BAR_0
WinMove, ahk_id %wndId%, , %x%, %y%