From 47f3b71b8eb13a44778635fdd75c4ebd89ebc0d1 Mon Sep 17 00:00:00 2001 From: Martijn Laan <1092369+martijnlaan@users.noreply.github.com> Date: Sat, 15 Jun 2024 17:09:13 +0200 Subject: [PATCH] Fix WM_SYSCOLORCHANGE forward. --- Components/ScintEdit.pas | 7 ++++++- Projects/Src/CompForm.pas | 8 ++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/Components/ScintEdit.pas b/Components/ScintEdit.pas index 493cfbdab..98ddd1fe4 100644 --- a/Components/ScintEdit.pas +++ b/Components/ScintEdit.pas @@ -294,6 +294,7 @@ TScintEdit = class(TWinControl) procedure SetWordChars(const S: AnsiString); procedure ShowAutoComplete(const CharsEntered: Integer; const WordList: AnsiString); procedure StyleNeeded(const EndPos: Integer); + procedure SysColorChange(const Message: TMessage); procedure Undo; procedure UpdateStyleAttributes; function WordAtCursor: String; @@ -1851,6 +1852,11 @@ procedure TScintEdit.StyleNeeded(const EndPos: Integer); end; end; +procedure TScintEdit.SysColorChange(const Message: TMessage); +begin + ForwardMessage(Message); +end; + procedure TScintEdit.Undo; begin Call(SCI_UNDO, 0, 0); @@ -2046,7 +2052,6 @@ procedure TScintEdit.CMHintShow(var Message: TCMHintShow); procedure TScintEdit.CMSysColorChange(var Message: TMessage); begin inherited; - ForwardMessage(Message); UpdateStyleAttributes; end; diff --git a/Projects/Src/CompForm.pas b/Projects/Src/CompForm.pas index c332fe4bb..2df762dc8 100644 --- a/Projects/Src/CompForm.pas +++ b/Projects/Src/CompForm.pas @@ -578,6 +578,7 @@ TCompileForm = class(TUIStateForm) procedure WMStartNormally(var Message: TMessage); message WM_StartNormally; procedure WMDPIChanged(var Message: TMessage); message WM_DPICHANGED; procedure WMSettingChange(var Message: TMessage); message WM_SETTINGCHANGE; + procedure WMSysColorChange(var Message: TMessage); message WM_SYSCOLORCHANGE; procedure WMThemeChanged(var Message: TMessage); message WM_THEMECHANGED; procedure WMUAHDrawMenu(var Message: TMessage); message WM_UAHDRAWMENU; procedure WMUAHDrawMenuItem(var Message: TMessage); message WM_UAHDRAWMENUITEM; @@ -3014,6 +3015,13 @@ procedure TCompileForm.WMStartNormally(var Message: TMessage); OpenFile(FMainMemo, CommandLineFilename, False); end; +procedure TCompileForm.WMSysColorChange(var Message: TMessage); +begin + inherited; + for var Memo in FMemos do + Memo.SysColorChange(Message); +end; + procedure TCompileForm.UpdateReopenTabMenu(const Menu: TMenuItem); begin Menu.Clear;