Skip to content
This repository has been archived by the owner on Sep 4, 2024. It is now read-only.

[Gtk3] BoxBackend CustomContainer: adjust OnGetPreferredWidth & OnGetPreferredWidthForHeight #1039

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Xwt.Gtk/Xwt.GtkBackend/BoxBackendGtk3.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down