[BUG] submenu wrong location (#97)

This commit is contained in:
Markus Hofknecht 2020-06-20 21:02:03 +02:00
parent 11f44f9f79
commit 1ffb169765
2 changed files with 3 additions and 4 deletions

View file

@ -668,8 +668,7 @@ namespace SystemTrayMenu.Business
menu.Padding.Horizontal + menuPredecessor.Width); menu.Padding.Horizontal + menuPredecessor.Width);
if (directionToRight) if (directionToRight)
{ {
if (widthPredecessors - menu.Width <= if (widthPredecessors - menus[0].Width - menu.Width < 0)
-menu.Padding.Horizontal)
{ {
directionToRight = false; directionToRight = false;
} }
@ -679,7 +678,7 @@ namespace SystemTrayMenu.Business
} }
} }
else if (Statics.ScreenWidth < else if (Statics.ScreenWidth <
widthPredecessors + menuPredecessor.Width + menu.Width) widthPredecessors + menus[0].Width + menu.Width)
{ {
directionToRight = true; directionToRight = true;
widthPredecessors -= newWith; widthPredecessors -= newWith;

View file

@ -121,7 +121,7 @@ namespace SystemTrayMenu.Handler
rowData.MenuLevel = menu.Level; rowData.MenuLevel = menu.Level;
if (!rowData.IsContextMenuOpen && if (!rowData.IsContextMenuOpen &&
rowData.ContainsMenu && rowData.ContainsMenu &&
rowData.MenuLevel < MenuDefines.MenusMax) rowData.MenuLevel + 1 < MenuDefines.MenusMax)
{ {
StartLoadMenu.Invoke(rowData); StartLoadMenu.Invoke(rowData);
} }