Allow negative horizontal/vertical menu offsets (#1629)

Menu offsets were previously applied to s_MainMenuLimits.
Though when deciding where to put start menu (CalculateCorner) we are
now taking into account also position of start button (as since Win11 it
may not be in corner of the screen).

This broke negative menu offsets.

We will fix it by applying menu offsets in CalculateCorner as a last
step once we have determined start menu position.
This should make even more sense than previous approach.
This commit is contained in:
ge0rdi
2023-07-31 14:10:46 +02:00
parent 2f251c4f63
commit 4b26b4d9e6

View File

@@ -7509,31 +7509,6 @@ RECT CMenuContainer::CalculateWorkArea( const RECT &taskbarRect )
}
}
//calculate offsets
int xOff = GetSettingInt(L"HorizontalMenuOffset");
int yOff = GetSettingInt(L"VerticalMenuOffset");
if (s_TaskBarEdge == ABE_BOTTOM)
{
if (xOff != 0)
rc.left += xOff;
if (yOff != 0)
rc.bottom += yOff;
}
else if (s_TaskBarEdge == ABE_TOP || s_TaskBarEdge == ABE_LEFT)
{
if (xOff != 0)
rc.left += xOff;
if (yOff != 0)
rc.top += yOff;
}
else
{
if (xOff != 0)
rc.right += xOff;
if (yOff != 0)
rc.top += yOff;
}
return rc;
}
@@ -7560,6 +7535,9 @@ POINT CMenuContainer::CalculateCorner( void )
else
corner.y=s_MainMenuLimits.bottom+margin.bottom;
corner.x+=GetSettingInt(L"HorizontalMenuOffset");
corner.y+=GetSettingInt(L"VerticalMenuOffset");
return corner;
}