IDE: RestoreSimpleLayout: trigger layoutchanged only if something changed

git-svn-id: trunk@49798 -
This commit is contained in:
mattias 2015-09-09 15:26:07 +00:00
parent 5195829561
commit f228ab12a3
2 changed files with 6 additions and 2 deletions

View File

@ -2041,7 +2041,7 @@ begin
// clean up
FreeAndNil(fTreeNameToDocker);
ControlNames.Free;
// commit (this can raise an exception)
// commit (this can raise an exception, when it triggers events)
EnableAllAutoSizing;
end;
{$IFDEF VerboseAnchorDockRestore}

View File

@ -2239,22 +2239,26 @@ var
i: Integer;
ALayout: TSimpleWindowLayout;
AForm: TCustomForm;
HasChanged: Boolean;
begin
if IDEDockMaster=nil then
begin
HasChanged:=false;
for i:=SimpleLayoutStorage.Count-1 downto 0 do//loop down in order to keep z-order of the forms
begin
ALayout:=SimpleLayoutStorage[i];
AForm:=GetForm(ALayout.FormID,ALayout.Visible);
if AForm=nil then Continue;
HasChanged:=true;
ALayout.Apply(True);
if ALayout.Visible or (AForm=Application.MainForm) then
ShowForm(AForm,true)
else if AForm.Visible then
AForm.Close;
end;
end;
if HasChanged then
LayoutChanged;
end;
end;
function TIDEWindowCreatorList.GetScreenrectForDefaults: TRect;