Browse Source

Give wizard form proper non-dark color which is white and not btnface.

Martijn Laan 2 months ago
parent
commit
6bda1449cb
2 changed files with 7 additions and 7 deletions
  1. 6 6
      Projects/Src/IDE.HelperFunc.pas
  2. 1 1
      Projects/Src/IDE.Wizard.WizardForm.pas

+ 6 - 6
Projects/Src/IDE.HelperFunc.pas

@@ -28,7 +28,7 @@ procedure InitFormFont(Form: TForm);
 procedure SetControlWindowTheme(const WinControl: TWinControl; const Dark: Boolean);
 procedure InitFormThemeInit(const Theme: TTheme);
 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 GetFileTitle(const Filename: String): String;
 function GetCleanFileNameOfFile(const Filename: String): String;
@@ -149,7 +149,7 @@ function InitFormTheme(const Form: TForm): Boolean;
 begin
   Result := (Form = MainForm) or FormTheme.Dark;
   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
       Unlike this article we check for Windows 10 Version 2004 because that's the first version
@@ -165,12 +165,12 @@ begin
   end;
 end;
 
-function InitFormThemeGetBkColor(const Form: TForm): TColor;
+function InitFormThemeGetBkColor(const WindowColor: Boolean): TColor;
 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
-    Result := FormTheme.Colors[tcToolBack];
+    Result := FormTheme.Colors[tcToolBack]; { This is gray/btnface if not dark mode }
 end;
 
 function GetDisplayFilename(const Filename: String): String;

+ 1 - 1
Projects/Src/IDE.Wizard.WizardForm.pas

@@ -299,7 +299,7 @@ begin
 
   InitFormFont(Self);
   if not InitFormTheme(Self) then
-    OuterNotebook.Color := InitFormThemeGetBkColor(Self);
+    OuterNotebook.Color := InitFormThemeGetBkColor(True);
 
   if Font.Name = 'Segoe UI' then begin
     { See Setup.WizardForm.pas }