Skip to content

Commit

Permalink
Issues #24 Made width and height attributes as optional for windowSiz…
Browse files Browse the repository at this point in the history
…eItems section (supplement)
  • Loading branch information
AlexanderPro committed Jun 24, 2024
1 parent f66386c commit 214cd57
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions SmartContextMenu/Forms/MainForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -695,11 +695,17 @@ private void MenuItemClick(Window window, WindowSizeMenuItem menuItem)
else if (_settings.Sizer == WindowSizerType.WindowWithoutMargins)
{
var margins = window.GetSystemMargins();
window.SetSize(menuItem.Width + margins.Left + margins.Right, menuItem.Height + margins.Top + margins.Bottom, menuItem.Left, menuItem.Top);
window.SetSize(menuItem.Width == null ? null : (menuItem.Width + margins.Left + margins.Right),
menuItem.Height == null ? null : (menuItem.Height + margins.Top + margins.Bottom),
menuItem.Left,
menuItem.Top);
}
else
{
window.SetSize(menuItem.Width + (window.Size.Width - window.ClientSize.Width), menuItem.Height + (window.Size.Height - window.ClientSize.Height), menuItem.Left, menuItem.Top);
window.SetSize(menuItem.Width == null ? null : (menuItem.Width + (window.Size.Width - window.ClientSize.Width)),
menuItem.Height == null ? null : (menuItem.Height + (window.Size.Height - window.ClientSize.Height)),
menuItem.Left,
menuItem.Top);
}
}

Expand Down

0 comments on commit 214cd57

Please sign in to comment.