mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-11 19:16:16 +02:00
IDE: Reduce component palette updates at the start. Aims for snappier boot of Lazarus.
git-svn-id: trunk@47099 -
This commit is contained in:
parent
d16d9236fd
commit
34ca493ff0
21
ide/main.pp
21
ide/main.pp
@ -3673,13 +3673,22 @@ begin
|
||||
end;
|
||||
|
||||
procedure TMainIDE.UpdateIDEComponentPalette(IfFormChanged: boolean);
|
||||
var
|
||||
OldLastCompPaletteForm: TCustomForm;
|
||||
begin
|
||||
if IfFormChanged and (fLastCompPaletteForm=LastFormActivated) then exit;
|
||||
// Package manager updates the palette initially.
|
||||
if not FIDEStarted
|
||||
or (IfFormChanged and (fLastCompPaletteForm=LastFormActivated)) then
|
||||
exit;
|
||||
OldLastCompPaletteForm:=fLastCompPaletteForm;
|
||||
fLastCompPaletteForm:=LastFormActivated;
|
||||
IDEComponentPalette.HideControls:=(LastFormActivated<>nil)
|
||||
and (LastFormActivated.Designer<>nil)
|
||||
Assert(Assigned(LastFormActivated), 'TMainIDE.UpdateIDEComponentPalette: LastFormActivated = Nil');
|
||||
IDEComponentPalette.HideControls:= (LastFormActivated.Designer<>nil)
|
||||
and (LastFormActivated.Designer.LookupRoot<>nil)
|
||||
and not (LastFormActivated.Designer.LookupRoot is TControl);
|
||||
// Don't update palette at the first time if not hiding controls.
|
||||
if (OldLastCompPaletteForm = Nil) and not IDEComponentPalette.HideControls then
|
||||
exit;
|
||||
{$IFDEF VerboseComponentPalette}
|
||||
DebugLn(['* TMainIDE.UpdateIDEComponentPalette: Updating palette *',
|
||||
', HideControls=', IDEComponentPalette.HideControls]);
|
||||
@ -8589,7 +8598,8 @@ begin
|
||||
NewForm.Invalidate;
|
||||
{$IFDEF VerboseComponentPalette}
|
||||
DebugLn('***');
|
||||
DebugLn('** TMainIDE.OnControlSelectionFormChanged: Calling UpdateIDEComponentPalette(true) **');
|
||||
DebugLn(['** TMainIDE.OnControlSelectionFormChanged: Calling UpdateIDEComponentPalette(true)',
|
||||
', IDEStarted=', FIDEStarted, ' **']);
|
||||
{$ENDIF}
|
||||
UpdateIDEComponentPalette(true);
|
||||
end;
|
||||
@ -10528,7 +10538,8 @@ begin
|
||||
LastFormActivated := (Sender as TDesigner).Form;
|
||||
{$IFDEF VerboseComponentPalette}
|
||||
DebugLn('***');
|
||||
DebugLn('** TMainIDE.OnDesignerActivated: Calling UpdateIDEComponentPalette(true) **');
|
||||
DebugLn(['** TMainIDE.OnDesignerActivated: Calling UpdateIDEComponentPalette(true)',
|
||||
', IDEStarted=', FIDEStarted, ' **']);
|
||||
{$ENDIF}
|
||||
UpdateIDEComponentPalette(true);
|
||||
end;
|
||||
|
Loading…
Reference in New Issue
Block a user