Skip to content

Commit

Permalink
Gtk: Ensure controls inside PixelLayout get resized immediately
Browse files Browse the repository at this point in the history
Fixes #1752
  • Loading branch information
cwensley committed Apr 24, 2022
1 parent 9364d9a commit f5b0b98
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/Eto.Gtk/Forms/PixelLayoutHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,18 @@ public void Add(Control child, int x, int y)
ctl.CurrentLocation = new Point(x, y);
InvalidateMeasure();
}
public override void InvalidateMeasure()
{
base.InvalidateMeasure();
#if GTKCORE
if (Widget.Loaded)
{
// same as Control.ResizeChildren(), but non-obsolete.
Control.GetAllocatedSize(out var allocation, out var baseline);
Control.SizeAllocateWithBaseline(allocation, baseline);
}
#endif
}

public void Move(Control child, int x, int y)
{
Expand Down

0 comments on commit f5b0b98

Please sign in to comment.