mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-12-06 06:31:37 +01:00
LCL: fix autosizing for not-aligned controls. Issue #28654
git-svn-id: trunk@56947 -
This commit is contained in:
parent
8726ea2759
commit
9ecac75432
@ -3025,28 +3025,27 @@ procedure TControl.DoAllAutoSize;
|
|||||||
var
|
var
|
||||||
AWinControl: TWinControl;
|
AWinControl: TWinControl;
|
||||||
i: Integer;
|
i: Integer;
|
||||||
Needed: Boolean;
|
|
||||||
begin
|
begin
|
||||||
if AControl.AutoSizeDelayed then exit;
|
if AControl.AutoSizeDelayed then exit;
|
||||||
Needed:=cfAutoSizeNeeded in AControl.FControlFlags;
|
|
||||||
|
|
||||||
//DebugLn(['TControl.DoAllAutoSize.AutoSizeControl ',DbgSName(AControl),' AutoSize=',AControl.AutoSize,' IsControlVisible=',AControl.IsControlVisible,' cfAutoSizeNeeded=',Needed]);
|
//DebugLn(['TControl.DoAllAutoSize.AutoSizeControl ',DbgSName(AControl),' AutoSize=',AControl.AutoSize,' IsControlVisible=',AControl.IsControlVisible,' cfAutoSizeNeeded=',Needed]);
|
||||||
Exclude(AControl.FControlFlags, cfAutoSizeNeeded);
|
if AControl.IsControlVisible then
|
||||||
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
|
begin
|
||||||
// recursive
|
if (cfAutoSizeNeeded in AControl.FControlFlags) and AControl.AutoSize and
|
||||||
AWinControl := TWinControl(AControl);
|
(not ((AControl.Parent = nil) and (csDesigning in AControl.ComponentState)))
|
||||||
//DebugLn(['AutoSizeControl ',DbgSName(AWinControl)]);
|
then
|
||||||
AWinControl.AlignControl(nil);
|
AControl.DoAutoSize;
|
||||||
for i := 0 to AWinControl.ControlCount - 1 do
|
if AControl is TWinControl then
|
||||||
AutoSizeControl(AWinControl.Controls[i]);
|
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;
|
||||||
end;
|
end;
|
||||||
|
Exclude(AControl.FControlFlags, cfAutoSizeNeeded);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function CallAllOnResize(AControl: TControl): boolean;
|
function CallAllOnResize(AControl: TControl): boolean;
|
||||||
|
|||||||
@ -2554,6 +2554,8 @@ var
|
|||||||
CurControl: TControl;
|
CurControl: TControl;
|
||||||
begin
|
begin
|
||||||
Result := True;
|
Result := True;
|
||||||
|
if cfAutoSizeNeeded in FControlFlags then
|
||||||
|
Exit;
|
||||||
for I := ControlCount - 1 downto 0 do
|
for I := ControlCount - 1 downto 0 do
|
||||||
begin
|
begin
|
||||||
CurControl:=Controls[I];
|
CurControl:=Controls[I];
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user