|
@@ -28,7 +28,7 @@ procedure InitFormFont(Form: TForm);
|
|
procedure SetControlWindowTheme(const WinControl: TWinControl; const Dark: Boolean);
|
|
procedure SetControlWindowTheme(const WinControl: TWinControl; const Dark: Boolean);
|
|
procedure InitFormThemeInit(const Theme: TTheme);
|
|
procedure InitFormThemeInit(const Theme: TTheme);
|
|
function InitFormTheme(const Form: TForm): Boolean;
|
|
function InitFormTheme(const Form: TForm): Boolean;
|
|
-function InitFormThemeGetBkColor(const Form: TForm): TColor;
|
|
|
|
|
|
+function InitFormThemeGetBkColor(const WindowColor: Boolean): TColor;
|
|
function GetDisplayFilename(const Filename: String): String;
|
|
function GetDisplayFilename(const Filename: String): String;
|
|
function GetFileTitle(const Filename: String): String;
|
|
function GetFileTitle(const Filename: String): String;
|
|
function GetCleanFileNameOfFile(const Filename: String): String;
|
|
function GetCleanFileNameOfFile(const Filename: String): String;
|
|
@@ -149,7 +149,7 @@ function InitFormTheme(const Form: TForm): Boolean;
|
|
begin
|
|
begin
|
|
Result := (Form = MainForm) or FormTheme.Dark;
|
|
Result := (Form = MainForm) or FormTheme.Dark;
|
|
if Result then begin
|
|
if Result then begin
|
|
- Form.Color := InitFormThemeGetBkColor(Form);
|
|
|
|
|
|
+ Form.Color := InitFormThemeGetBkColor(Form = MainForm);
|
|
|
|
|
|
{ Based on https://learn.microsoft.com/en-us/windows/apps/desktop/modernize/apply-windows-themes
|
|
{ Based on https://learn.microsoft.com/en-us/windows/apps/desktop/modernize/apply-windows-themes
|
|
Unlike this article we check for Windows 10 Version 2004 because that's the first version
|
|
Unlike this article we check for Windows 10 Version 2004 because that's the first version
|
|
@@ -165,12 +165,12 @@ begin
|
|
end;
|
|
end;
|
|
end;
|
|
end;
|
|
|
|
|
|
-function InitFormThemeGetBkColor(const Form: TForm): TColor;
|
|
|
|
|
|
+function InitFormThemeGetBkColor(const WindowColor: Boolean): TColor;
|
|
begin
|
|
begin
|
|
- if Form = MainForm then
|
|
|
|
- Result := FormTheme.Colors[tcBack]
|
|
|
|
|
|
+ if WindowColor then
|
|
|
|
+ Result := FormTheme.Colors[tcBack] { This is white/window if not dark mode }
|
|
else
|
|
else
|
|
- Result := FormTheme.Colors[tcToolBack];
|
|
|
|
|
|
+ Result := FormTheme.Colors[tcToolBack]; { This is gray/btnface if not dark mode }
|
|
end;
|
|
end;
|
|
|
|
|
|
function GetDisplayFilename(const Filename: String): String;
|
|
function GetDisplayFilename(const Filename: String): String;
|