mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-28 22:20:25 +02:00
lcl: AutoSize control (if needed) on child visibility change and on child remove (issue #0010605)
git-svn-id: trunk@14819 -
This commit is contained in:
parent
4b5895c501
commit
47a961ba28
@ -3241,11 +3241,17 @@ begin
|
||||
FVisible := Value;
|
||||
try
|
||||
Perform(CM_VISIBLECHANGED, WParam(Ord(Value)), 0);
|
||||
Include(FControlFlags,cfRequestAlignNeeded);
|
||||
Include(FControlFlags, cfRequestAlignNeeded);
|
||||
if (Self is TWinControl) then
|
||||
AsWincontrol := TWinControl(Self)
|
||||
else
|
||||
AsWincontrol := nil;
|
||||
// resize parent if it has autosize
|
||||
if (Parent <> nil) and Parent.AutoSize then
|
||||
begin
|
||||
Parent.InvalidatePreferredSize;
|
||||
Parent.AdjustSize;
|
||||
end;
|
||||
if FVisible then
|
||||
begin
|
||||
if AsWincontrol <> nil then
|
||||
|
@ -5642,7 +5642,14 @@ begin
|
||||
AControl.InvalidateControl(AControl.IsVisible, False, True);
|
||||
Remove(AControl);
|
||||
if not (csDestroying in ComponentState) then
|
||||
begin
|
||||
if AutoSize then
|
||||
begin
|
||||
InvalidatePreferredSize;
|
||||
AdjustSize;
|
||||
end;
|
||||
Realign;
|
||||
end;
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
|
Loading…
Reference in New Issue
Block a user