From ec8029f42d67c996036e5dfbe16ff18539402170 Mon Sep 17 00:00:00 2001 From: wp Date: Sat, 4 Jan 2020 14:26:03 +0000 Subject: [PATCH] LCL/FlowPanel: Fix AutoSize issue (issue #36514). git-svn-id: trunk@62486 - --- lcl/include/customflowpanel.inc | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/lcl/include/customflowpanel.inc b/lcl/include/customflowpanel.inc index 76c74a0d82..2db6e684bd 100644 --- a/lcl/include/customflowpanel.inc +++ b/lcl/include/customflowpanel.inc @@ -401,13 +401,22 @@ begin begin xControl := FControlList.Items[I].Control; if FFlowStyle in [fsLeftRightTopBottom, fsRightLeftTopBottom, fsLeftRightBottomTop, fsRightLeftBottomTop] then + begin PreferredHeight := Max(PreferredHeight, xControl.BoundsRect.Bottom+xControl.BorderSpacing.Around+xControl.BorderSpacing.Bottom + - xTestRect.Bottom-xClientRect.Bottom-xTestRect.Top+xClientRect.Top) - else + xTestRect.Bottom-xClientRect.Bottom-xTestRect.Top+xClientRect.Top); + PreferredWidth := Max(PreferredWidth, + xControl.Width + xControl.BorderSpacing.AroundLeft + xControl.BorderSpacing.AroundRight + ); + end else + begin PreferredWidth := Max(PreferredWidth, xControl.BoundsRect.Right+xControl.BorderSpacing.Around+xControl.BorderSpacing.Right + xTestRect.Right-xClientRect.Right-xTestRect.Left+xClientRect.Left); + PreferredHeight := Max(PreferredHeight, + xControl.Height + xControl.BorderSpacing.AroundTop + xControl.BorderSpacing.AroundBottom + ); + end; end; end; end;