Skip to content

Commit

Permalink
WinForms: Fix loading maximization state and layouting
Browse files Browse the repository at this point in the history
Fixes #453
Fixes #487
  • Loading branch information
cyanfish committed Dec 23, 2024
1 parent 0631638 commit 6757bba
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion NAPS2.Lib/EtoForms/Layout/LayoutController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,22 @@ public void Bind(Window window)
window.Content = _layout;
window.LoadComplete += (_, _) =>
{
_isShown = true;
if (window is not Form)
{
// For dialogs loading is equivalent to being shown
_isShown = true;
}
DoLayout();
};
window.Shown += (_, _) =>
{
// For forms, it's possible they might be maximized between LoadComplete and Shown so we need to relayout
if (window is Form)
{
_isShown = true;
DoLayout();
}
};
window.SizeChanged += (_, _) => DoLayout();
}

Expand Down

0 comments on commit 6757bba

Please sign in to comment.