Skip to content

Commit 4b26b4d

Browse files
committed
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.
1 parent 2f251c4 commit 4b26b4d

File tree

1 file changed

+3
-25
lines changed

1 file changed

+3
-25
lines changed

Src/StartMenu/StartMenuDLL/MenuContainer.cpp

Lines changed: 3 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -7509,31 +7509,6 @@ RECT CMenuContainer::CalculateWorkArea( const RECT &taskbarRect )
75097509
}
75107510
}
75117511

7512-
//calculate offsets
7513-
int xOff = GetSettingInt(L"HorizontalMenuOffset");
7514-
int yOff = GetSettingInt(L"VerticalMenuOffset");
7515-
if (s_TaskBarEdge == ABE_BOTTOM)
7516-
{
7517-
if (xOff != 0)
7518-
rc.left += xOff;
7519-
if (yOff != 0)
7520-
rc.bottom += yOff;
7521-
}
7522-
else if (s_TaskBarEdge == ABE_TOP || s_TaskBarEdge == ABE_LEFT)
7523-
{
7524-
if (xOff != 0)
7525-
rc.left += xOff;
7526-
if (yOff != 0)
7527-
rc.top += yOff;
7528-
}
7529-
else
7530-
{
7531-
if (xOff != 0)
7532-
rc.right += xOff;
7533-
if (yOff != 0)
7534-
rc.top += yOff;
7535-
}
7536-
75377512
return rc;
75387513
}
75397514

@@ -7560,6 +7535,9 @@ POINT CMenuContainer::CalculateCorner( void )
75607535
else
75617536
corner.y=s_MainMenuLimits.bottom+margin.bottom;
75627537

7538+
corner.x+=GetSettingInt(L"HorizontalMenuOffset");
7539+
corner.y+=GetSettingInt(L"VerticalMenuOffset");
7540+
75637541
return corner;
75647542
}
75657543

0 commit comments

Comments
 (0)