mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-08 09:38:12 +02:00
IDE: Restore visual components in component palette always when needed. Issue #30488.
git-svn-id: trunk@53812 -
This commit is contained in:
parent
21eaa54b10
commit
357ecf160c
@ -651,23 +651,18 @@ end;
|
||||
|
||||
procedure TMainIDEBar.UpdateIDEComponentPalette(IfFormChanged: boolean);
|
||||
var
|
||||
OldLastCompPaletteForm, LastActiveForm: TCustomForm;
|
||||
AResult: Boolean;
|
||||
LastActiveForm: TCustomForm;
|
||||
begin
|
||||
// Package manager updates the palette initially.
|
||||
LastActiveForm := LazarusIDE.LastFormActivated;
|
||||
if not LazarusIDE.IDEStarted
|
||||
or (IfFormChanged and (LastCompPaletteForm=LastActiveForm)) then
|
||||
exit;
|
||||
OldLastCompPaletteForm:=LastCompPaletteForm;
|
||||
LastCompPaletteForm:=LastActiveForm;
|
||||
AResult:=(LastActiveForm<>nil) and (LastActiveForm.Designer<>nil)
|
||||
LastCompPaletteForm := LastActiveForm;
|
||||
IDEComponentPalette.HideControls :=
|
||||
(LastActiveForm<>nil) and (LastActiveForm.Designer<>nil)
|
||||
and (LastActiveForm.Designer.LookupRoot<>nil)
|
||||
and not (LastActiveForm.Designer.LookupRoot is TControl);
|
||||
IDEComponentPalette.HideControls:=AResult;
|
||||
// Don't update palette at the first time if not hiding controls.
|
||||
if (OldLastCompPaletteForm = Nil) and not IDEComponentPalette.HideControls then
|
||||
exit;
|
||||
{$IFDEF VerboseComponentPalette}
|
||||
DebugLn(['* TMainIDEBar.UpdateIDEComponentPalette: Updating palette *',
|
||||
', HideControls=', IDEComponentPalette.HideControls]);
|
||||
|
Loading…
Reference in New Issue
Block a user