From 4619b1b09851c327d29db3f8fade825db48a7560 Mon Sep 17 00:00:00 2001 From: paul Date: Mon, 30 Jun 2008 03:15:43 +0000 Subject: [PATCH] lcl: on changing Form.Icon or Application.Icon set its current to best index for application git-svn-id: trunk@15616 - --- lcl/include/application.inc | 5 +++++ lcl/include/customform.inc | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/lcl/include/application.inc b/lcl/include/application.inc index 7d0bc131ed..9a0fab20d6 100644 --- a/lcl/include/application.inc +++ b/lcl/include/application.inc @@ -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; {------------------------------------------------------------------------------ diff --git a/lcl/include/customform.inc b/lcl/include/customform.inc index 1b9238bca7..a4455ca120 100644 --- a/lcl/include/customform.inc +++ b/lcl/include/customform.inc @@ -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; {------------------------------------------------------------------------------