From 229a87d9b8ec7b9a7767028a8ef26727564f2624 Mon Sep 17 00:00:00 2001 From: lytico Date: Wed, 20 May 2020 16:01:06 +0200 Subject: [PATCH] [Gtk3] BoxBackend CustomContainer: adjust OnGetPreferredWidth & OnGetPreferredWidthForHeight --- Xwt.Gtk/Xwt.GtkBackend/BoxBackendGtk3.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Xwt.Gtk/Xwt.GtkBackend/BoxBackendGtk3.cs b/Xwt.Gtk/Xwt.GtkBackend/BoxBackendGtk3.cs index ee9d62da9..19367d8b9 100644 --- a/Xwt.Gtk/Xwt.GtkBackend/BoxBackendGtk3.cs +++ b/Xwt.Gtk/Xwt.GtkBackend/BoxBackendGtk3.cs @@ -92,9 +92,9 @@ protected override void OnGetPreferredWidth (out int minimum_width, out int natu // dirty fix: do not constrain height on first allocation var force_height = SizeConstraint.Unconstrained; if (IsReallocating) - force_height = SizeConstraint.WithSize (Allocation.Width); + force_height = SizeConstraint.WithSize (Allocation.Height); var size = OnGetRequisition (SizeConstraint.Unconstrained, force_height); - if (size.Height < WidthRequest) + if (size.Width < WidthRequest) minimum_width = natural_width = WidthRequest; else minimum_width = natural_width = size.Width; @@ -112,7 +112,7 @@ protected override void OnGetPreferredHeightForWidth (int width, out int minimum protected override void OnGetPreferredWidthForHeight (int height, out int minimum_width, out int natural_width) { var size = OnGetRequisition (SizeConstraint.Unconstrained, SizeConstraint.WithSize (height)); - if (size.Height < WidthRequest) + if (size.Width < WidthRequest) minimum_width = natural_width = WidthRequest; else minimum_width = natural_width = size.Width;