|
@@ -680,7 +680,7 @@ var
|
|
|
implementation
|
|
|
|
|
|
uses
|
|
|
- ActiveX, Clipbrd, ShellApi, ShlObj, IniFiles, Registry, Consts, Types, UITypes,
|
|
|
+ ActiveX, Clipbrd, ShellApi, ShlObj, IniFiles, Registry, Consts, Types, UITypes, Themes,
|
|
|
Math, StrUtils, WideStrUtils, TypInfo,
|
|
|
PathFunc, Shared.CommonFunc.Vcl, Shared.CommonFunc, Shared.FileClass, IDE.Messages, NewUxTheme.TmSchema, BrowseFunc,
|
|
|
IDE.HtmlHelpFunc, TaskbarProgressFunc, IDE.ImagesModule,
|
|
@@ -6553,18 +6553,43 @@ begin
|
|
|
end;
|
|
|
|
|
|
procedure TMainForm.UpdateTheme;
|
|
|
+
|
|
|
+ procedure SetListBoxWindowTheme(const ListBox: TListBox);
|
|
|
+ begin
|
|
|
+ ListBox.Font.Color := FTheme.Colors[tcFore];
|
|
|
+ ListBox.Color := FTheme.Colors[tcBack];
|
|
|
+ ListBox.Invalidate;
|
|
|
+ SetControlWindowTheme(ListBox, FTheme.Dark);
|
|
|
+ end;
|
|
|
+
|
|
|
begin
|
|
|
FTheme.Typ := FOptions.ThemeType;
|
|
|
|
|
|
SetHelpFileDark(FTheme.Dark);
|
|
|
|
|
|
+ { For MainForm the active style only impacts message boxes and tooltips: FMemos, Toolbar, SplitPanel, StatusBar
|
|
|
+ and the 4 ListBoxes ignore it because their StyleName property is set to 'Windows' always. Additionally,
|
|
|
+ for scrollbars and StatusBar, MainForm's StyleElements is empty. Menus ignore it because shMenus is removed
|
|
|
+ from TStyleManager.SystemHooks at startup. }
|
|
|
+ if FTheme.Dark then
|
|
|
+ TStyleManager.TrySetStyle('Windows11 Modern Dark')
|
|
|
+ else
|
|
|
+ TStyleManager.TrySetStyle('Windows');
|
|
|
+ { For some reason only MainForm needs this: with StyleName set to an empty string, dialog boxes look bad }
|
|
|
+ StyleName := TStyleManager.ActiveStyle.Name;
|
|
|
+
|
|
|
+ InitFormTheme(Self);
|
|
|
+
|
|
|
+ ToolbarPanel.Color := FTheme.Colors[tcToolBack];
|
|
|
+
|
|
|
for var Memo in FMemos do begin
|
|
|
Memo.UpdateThemeColorsAndStyleAttributes;
|
|
|
SetControlWindowTheme(Memo, FTheme.Dark);
|
|
|
end;
|
|
|
-
|
|
|
- InitFormTheme(Self);
|
|
|
- ToolbarPanel.Color := FTheme.Colors[tcToolBack];
|
|
|
+ SetListBoxWindowTheme(CompilerOutputList);
|
|
|
+ SetListBoxWindowTheme(DebugOutputList);
|
|
|
+ SetListBoxWindowTheme(DebugCallStackList);
|
|
|
+ SetListBoxWindowTheme(FindResultsList);
|
|
|
|
|
|
if FTheme.Dark then begin
|
|
|
ThemedToolbarVirtualImageList.ImageCollection := ImagesModule.DarkToolBarImageCollection;
|
|
@@ -7484,7 +7509,7 @@ end;
|
|
|
{ Should be removed if the main menu ever gets removed }
|
|
|
procedure TMainForm.UAHDrawMenuBottomLine;
|
|
|
begin
|
|
|
- if FTheme.Dark then begin
|
|
|
+ if not (csDestroying in ComponentState) and (FTheme <> nil) and FTheme.Dark then begin
|
|
|
var ClientRect: TRect;
|
|
|
Windows.GetClientRect(Handle, ClientRect);
|
|
|
MapWindowPoints(Handle, 0, ClientRect, 2);
|