mirror of
https://github.com/Open-Shell/Open-Shell-Menu.git
synced 2026-04-11 17:37:22 +10:00
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:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user