Forráskód Böngészése

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

Martijn Laan 2 hónapja
szülő
commit
6bda1449cb

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

@@ -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;

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

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