Commit 81c4a099 authored by ondrej's avatar ondrej
Browse files

LCL: fix regression in autosize after r56947 #9ecac754. Issue #28654

git-svn-id: trunk@57082 -
parent 9d515687
......@@ -3017,27 +3017,28 @@ procedure TControl.DoAllAutoSize;
var
AWinControl: TWinControl;
i: Integer;
Needed: Boolean;
begin
if AControl.AutoSizeDelayed then exit;
Needed:=cfAutoSizeNeeded in AControl.FControlFlags;
//DebugLn(['TControl.DoAllAutoSize.AutoSizeControl ',DbgSName(AControl),' AutoSize=',AControl.AutoSize,' IsControlVisible=',AControl.IsControlVisible,' cfAutoSizeNeeded=',Needed]);
if AControl.IsControlVisible then
Exclude(AControl.FControlFlags, cfAutoSizeNeeded);
if not AControl.IsControlVisible then exit;
if Needed and AControl.AutoSize and
(not ((AControl.Parent = nil) and (csDesigning in AControl.ComponentState)))
then
AControl.DoAutoSize;
if AControl is TWinControl then
begin
if (cfAutoSizeNeeded in AControl.FControlFlags) and AControl.AutoSize and
(not ((AControl.Parent = nil) and (csDesigning in AControl.ComponentState)))
then
AControl.DoAutoSize;
if AControl is TWinControl then
begin
// recursive
AWinControl := TWinControl(AControl);
//DebugLn(['AutoSizeControl ',DbgSName(AWinControl)]);
AWinControl.AlignControl(nil);
for i := 0 to AWinControl.ControlCount - 1 do
AutoSizeControl(AWinControl.Controls[i]);
end;
// recursive
AWinControl := TWinControl(AControl);
//DebugLn(['AutoSizeControl ',DbgSName(AWinControl)]);
AWinControl.AlignControl(nil);
for i := 0 to AWinControl.ControlCount - 1 do
AutoSizeControl(AWinControl.Controls[i]);
end;
Exclude(AControl.FControlFlags, cfAutoSizeNeeded);
end;
function CallAllOnResize(AControl: TControl): boolean;
......
......@@ -2554,8 +2554,6 @@ var
CurControl: TControl;
begin
Result := True;
if cfAutoSizeNeeded in FControlFlags then
Exit;
for I := ControlCount - 1 downto 0 do
begin
CurControl:=Controls[I];
......@@ -2563,6 +2561,7 @@ var
or (CurControl.Anchors <> [akLeft, akTop])
or (CurControl.AnchorSide[akLeft].Control<>nil)
or (CurControl.AnchorSide[akTop].Control<>nil)
or (cfAutoSizeNeeded in CurControl.FControlFlags)
or (ChildSizing.Layout<>cclNone)
then Exit;
end;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment