LCL: Allow updating image in TMenuItem externally. Issue #36607, patch from Anton Kavalenka.

git-svn-id: trunk@62585 -
This commit is contained in:
juha 2020-01-24 19:41:10 +00:00
parent fab987c917
commit a79371c9f2

View File

@ -1462,7 +1462,7 @@ procedure TMenuItem.UpdateImage(forced: Boolean);
var
ImgList: TCustomImageList;
begin
if HandleAllocated and ([csLoading, csDestroying] * ComponentState = []) then
if [csLoading, csDestroying] * ComponentState = [] then
begin
ImgList := GetImageList;
if FBitmapIsValid then // Bitmap is assigned through Bitmap property
@ -1481,7 +1481,8 @@ begin
FBitmapIsValid := True;
end;
end;
UpdateWSIcon;
if HandleAllocated then
UpdateWSIcon;
end;
end;