From 341b9e725b75f7446e8733be5e82f90c60f88ead Mon Sep 17 00:00:00 2001 From: Marius Ungureanu Date: Tue, 28 Nov 2017 09:54:52 +0200 Subject: [PATCH] [Gtk] Add OnSizeRequested callbacks to children. (#732) --- Xwt.Gtk/Xwt.GtkBackend/BoxBackendGtk2.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Xwt.Gtk/Xwt.GtkBackend/BoxBackendGtk2.cs b/Xwt.Gtk/Xwt.GtkBackend/BoxBackendGtk2.cs index 9f12f4c16..fd4ccb848 100644 --- a/Xwt.Gtk/Xwt.GtkBackend/BoxBackendGtk2.cs +++ b/Xwt.Gtk/Xwt.GtkBackend/BoxBackendGtk2.cs @@ -24,6 +24,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; +using System.Linq; namespace Xwt.GtkBackend { @@ -34,6 +35,13 @@ public void QueueResizeIfRequired() if (!IsReallocating) QueueResize (); } + + protected override void OnSizeRequested (ref Gtk.Requisition requisition) + { + base.OnSizeRequested (ref requisition); + foreach (var c in children.Keys.ToArray ()) + c.SizeRequest (); + } } }