Skip to content

Commit 214cd57

Browse files
committed
Issues #24 Made width and height attributes as optional for windowSizeItems section (supplement)
1 parent f66386c commit 214cd57

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

SmartContextMenu/Forms/MainForm.cs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -695,11 +695,17 @@ private void MenuItemClick(Window window, WindowSizeMenuItem menuItem)
695695
else if (_settings.Sizer == WindowSizerType.WindowWithoutMargins)
696696
{
697697
var margins = window.GetSystemMargins();
698-
window.SetSize(menuItem.Width + margins.Left + margins.Right, menuItem.Height + margins.Top + margins.Bottom, menuItem.Left, menuItem.Top);
698+
window.SetSize(menuItem.Width == null ? null : (menuItem.Width + margins.Left + margins.Right),
699+
menuItem.Height == null ? null : (menuItem.Height + margins.Top + margins.Bottom),
700+
menuItem.Left,
701+
menuItem.Top);
699702
}
700703
else
701704
{
702-
window.SetSize(menuItem.Width + (window.Size.Width - window.ClientSize.Width), menuItem.Height + (window.Size.Height - window.ClientSize.Height), menuItem.Left, menuItem.Top);
705+
window.SetSize(menuItem.Width == null ? null : (menuItem.Width + (window.Size.Width - window.ClientSize.Width)),
706+
menuItem.Height == null ? null : (menuItem.Height + (window.Size.Height - window.ClientSize.Height)),
707+
menuItem.Left,
708+
menuItem.Top);
703709
}
704710
}
705711

0 commit comments

Comments
 (0)