mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-10 14:36:09 +02:00
lcl: on changing Form.Icon or Application.Icon set its current to best index for application
git-svn-id: trunk@15616 -
This commit is contained in:
parent
3152e64236
commit
4619b1b098
@ -869,10 +869,15 @@ procedure TApplication.IconChanged(Sender: TObject);
|
||||
var
|
||||
i: integer;
|
||||
begin
|
||||
Icon.OnChange := nil;
|
||||
|
||||
Icon.Current := Icon.GetBestApplicationIndex;
|
||||
Widgetset.AppSetIcon(GetIconHandle);
|
||||
if FFormList<>nil then
|
||||
for i :=0 to FFormList.Count - 1 do
|
||||
TForm(FFormList[i]).Perform(CM_ICONCHANGED, 0, 0);
|
||||
|
||||
Icon.OnChange := @IconChanged;
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
|
@ -161,8 +161,13 @@ End;
|
||||
------------------------------------------------------------------------------}
|
||||
procedure TCustomForm.IconChanged(Sender: TObject);
|
||||
begin
|
||||
Icon.OnChange := nil;
|
||||
|
||||
Icon.Current := Icon.GetBestApplicationIndex;
|
||||
if HandleAllocated then
|
||||
TWSCustomFormClass(WidgetSetClass).SetIcon(Self, GetIconHandle);
|
||||
|
||||
Icon.OnChange := @IconChanged;
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
|
Loading…
Reference in New Issue
Block a user