mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-01 23:00:27 +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;
|
FVisible := Value;
|
||||||
try
|
try
|
||||||
Perform(CM_VISIBLECHANGED, WParam(Ord(Value)), 0);
|
Perform(CM_VISIBLECHANGED, WParam(Ord(Value)), 0);
|
||||||
Include(FControlFlags,cfRequestAlignNeeded);
|
Include(FControlFlags, cfRequestAlignNeeded);
|
||||||
if (Self is TWinControl) then
|
if (Self is TWinControl) then
|
||||||
AsWincontrol := TWinControl(Self)
|
AsWincontrol := TWinControl(Self)
|
||||||
else
|
else
|
||||||
AsWincontrol := nil;
|
AsWincontrol := nil;
|
||||||
|
// resize parent if it has autosize
|
||||||
|
if (Parent <> nil) and Parent.AutoSize then
|
||||||
|
begin
|
||||||
|
Parent.InvalidatePreferredSize;
|
||||||
|
Parent.AdjustSize;
|
||||||
|
end;
|
||||||
if FVisible then
|
if FVisible then
|
||||||
begin
|
begin
|
||||||
if AsWincontrol <> nil then
|
if AsWincontrol <> nil then
|
||||||
|
@ -5642,7 +5642,14 @@ begin
|
|||||||
AControl.InvalidateControl(AControl.IsVisible, False, True);
|
AControl.InvalidateControl(AControl.IsVisible, False, True);
|
||||||
Remove(AControl);
|
Remove(AControl);
|
||||||
if not (csDestroying in ComponentState) then
|
if not (csDestroying in ComponentState) then
|
||||||
|
begin
|
||||||
|
if AutoSize then
|
||||||
|
begin
|
||||||
|
InvalidatePreferredSize;
|
||||||
|
AdjustSize;
|
||||||
|
end;
|
||||||
Realign;
|
Realign;
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{------------------------------------------------------------------------------
|
{------------------------------------------------------------------------------
|
||||||
|
Loading…
Reference in New Issue
Block a user