From: <aka...@us...> - 2024-06-11 11:10:28
|
Revision: 4272 http://sourceforge.net/p/gexperts/code/4272 Author: akalwahome Date: 2024-06-11 11:10:26 +0000 (Tue, 11 Jun 2024) Log Message: ----------- FIX Bug #360: "About" window is now scaled to DPI. Modified Paths: -------------- branches/dark-mode/Projects/DelphiXx110Alexandria/GExpertsRS110.dproj branches/dark-mode/Source/Framework/GX_About.pas branches/dark-mode/Source/Utils/GX_OtaUtils.pas Property Changed: ---------------- branches/dark-mode/ Index: branches/dark-mode =================================================================== --- branches/dark-mode 2024-06-10 18:06:25 UTC (rev 4271) +++ branches/dark-mode 2024-06-11 11:10:26 UTC (rev 4272) Property changes on: branches/dark-mode ___________________________________________________________________ Modified: svn:mergeinfo ## -1 +1 ## -/trunk:4085-4262 \ No newline at end of property +/trunk:4085-4271 \ No newline at end of property Modified: branches/dark-mode/Projects/DelphiXx110Alexandria/GExpertsRS110.dproj =================================================================== --- branches/dark-mode/Projects/DelphiXx110Alexandria/GExpertsRS110.dproj 2024-06-10 18:06:25 UTC (rev 4271) +++ branches/dark-mode/Projects/DelphiXx110Alexandria/GExpertsRS110.dproj 2024-06-11 11:10:26 UTC (rev 4272) @@ -78,7 +78,7 @@ </PropertyGroup> <PropertyGroup Condition="'$(Cfg_2_Win32)'!=''"> <Debugger_HostApplication>$(BDS)\bin\bds.exe</Debugger_HostApplication> - <Debugger_RunParams>-rBDSPlain</Debugger_RunParams> + <Debugger_RunParams>-rBDSPlain -pDelphi</Debugger_RunParams> </PropertyGroup> <ItemGroup> <DelphiCompile Include="$(MainSource)"> Modified: branches/dark-mode/Source/Framework/GX_About.pas =================================================================== --- branches/dark-mode/Source/Framework/GX_About.pas 2024-06-10 18:06:25 UTC (rev 4271) +++ branches/dark-mode/Source/Framework/GX_About.pas 2024-06-11 11:10:26 UTC (rev 4272) @@ -91,6 +91,7 @@ constructor TfmAbout.Create(AOwner: TComponent); begin inherited; + TControl_SetMinConstraints(Self); GxSetDefaultFont(Self); TLabel_MakeUrlLabel(lblWebPage); Modified: branches/dark-mode/Source/Utils/GX_OtaUtils.pas =================================================================== --- branches/dark-mode/Source/Utils/GX_OtaUtils.pas 2024-06-10 18:06:25 UTC (rev 4271) +++ branches/dark-mode/Source/Utils/GX_OtaUtils.pas 2024-06-11 11:10:26 UTC (rev 4272) @@ -70,7 +70,8 @@ {$IFDEF GX_SUPPORTS_THEMING} function IdeStyleIsDark: Boolean; function IdeStyleService: TCustomStyleServices; -function GxOtaActiveTheme: string; +function GxOtaGetIDEThemingServices: IOTAIDEThemingServices; +function GxOtaActiveThemeName: string; function GxOtaGetStyleColor(AColor: TStyleColor; ADefault: TColor): TColor; function GxOtaGetStyleFontColor(AFontStyle: TStyleFont; ADefault: TColor = clNone): TColor; {$ENDIF} @@ -4024,29 +4025,36 @@ var LService: IOTAIDEThemingServices; begin + LService := GxOtaGetIDEThemingServices; + if Assigned(LService) then + Result := LService.StyleServices + else + Result := nil; +end; + +function GxOtaGetIDEThemingServices: IOTAIDEThemingServices; +var + LService: IOTAIDEThemingServices; +begin Result := nil; if Supports(BorlandIDEServices, IOTAIDEThemingServices, LService) then - begin - Result := LService.StyleServices; - end; + Result := LService; end; -function GxOtaActiveTheme: string; +function GxOtaActiveThemeName: string; var LService: IOTAIDEThemingServices; begin Result := ''; - if Supports(BorlandIDEServices, IOTAIDEThemingServices, LService) then - begin + LService := GxOtaGetIDEThemingServices; + if Assigned(LService) then Result := LService.ActiveTheme; - end; end; function IdeStyleIsDark: Boolean; begin - Result := SameText(GxOtaActiveTheme, 'Dark'); + Result := SameText(GxOtaActiveThemeName, 'Dark'); end; - {$ENDIF} function GxOtaThemingEnabled: Boolean; @@ -4055,10 +4063,9 @@ LService: IOTAIDEThemingServices; begin Result := False; - if Supports(BorlandIDEServices, IOTAIDEThemingServices, LService) then - begin + LService := GxOtaGetIDEThemingServices; + if Assigned(LService) then Result := LService.IDEThemingEnabled; - end; end; {$ELSE} begin @@ -4072,14 +4079,11 @@ LService: IOTAIDEThemingServices; begin Result := False; - if Assigned(AForm) - and Supports(BorlandIDEServices, IOTAIDEThemingServices, LService) + LService := GxOtaGetIDEThemingServices; + if Assigned(AForm) and Assigned(LService) and (LService.IDEThemingEnabled) then begin - if LService.IDEThemingEnabled then - begin - LService.ApplyTheme(AForm); - Result := True; - end; + LService.ApplyTheme(AForm); + Result := True; end; end; {$ELSE} @@ -4091,18 +4095,15 @@ function GxOtaInitTheming(AForm: TCustomForm): Boolean; {$IFDEF GX_SUPPORTS_THEMING} var - LService: IOTAIDEThemingServices; + LService : IOTAIDEThemingServices; begin Result := False; - if Assigned(AForm) - and Supports(BorlandIDEServices, IOTAIDEThemingServices, LService) - then begin - if LService.IDEThemingEnabled then - begin - LService.RegisterFormClass(TCustomFormClass(AForm.ClassType)); - LService.ApplyTheme(AForm); - Result := True; - end; + LService := GxOtaGetIDEThemingServices; + if Assigned(AForm) and Assigned(LService) and (LService.IDEThemingEnabled) then + begin + LService.RegisterFormClass(TCustomFormClass(AForm.ClassType)); + LService.ApplyTheme(AForm); + Result := True; end; end; {$ELSE} @@ -4117,12 +4118,10 @@ LService: IOTAIDEThemingServices; begin Result := AColor; - if Supports(BorlandIDEServices, IOTAIDEThemingServices, LService) then + LService := GxOtaGetIDEThemingServices; + if Assigned(LService) and LService.IDEThemingEnabled then begin - if LService.IDEThemingEnabled then - begin - Result := LService.StyleServices.GetSystemColor(AColor); - end; + Result := LService.StyleServices.GetSystemColor(AColor); end; {$ELSE} begin @@ -4136,12 +4135,10 @@ LService: IOTAIDEThemingServices; begin Result := ADefault; - if Supports(BorlandIDEServices, IOTAIDEThemingServices, LService) then + LService := GxOtaGetIDEThemingServices; + if Assigned(LService) and LService.IDEThemingEnabled then begin - if LService.IDEThemingEnabled then - begin - Result := LService.StyleServices.GetStyleColor(AColor); - end; + Result := LService.StyleServices.GetStyleColor(AColor); end; end; {$ENDIF} @@ -4152,12 +4149,10 @@ LService: IOTAIDEThemingServices; begin Result := ADefault; - if Supports(BorlandIDEServices, IOTAIDEThemingServices, LService) then + LService := GxOtaGetIDEThemingServices; + if Assigned(LService) and LService.IDEThemingEnabled then begin - if LService.IDEThemingEnabled then - begin - Result := LService.StyleServices.GetStyleFontColor(AFontStyle); - end; + Result := LService.StyleServices.GetStyleFontColor(AFontStyle); end; end; {$ENDIF} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |