Ignore:
Timestamp:
Dec 4, 2023, 12:13:15 PM (12 months ago)
Author:
chronos
Message:
  • Added: Custom DPI configuration in Settings dialog.
  • Fixed: Better High DPI support.
Location:
trunk/Packages/DpiControls
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Packages/DpiControls/Dpi.Common.pas

    r468 r473  
    77
    88const
    9   FixedDpi = 2*96;
    109  DpiControlsComponentPaletteName = 'DpiControls';
    1110
  • trunk/Packages/DpiControls/Dpi.Forms.pas

    r468 r473  
    228228    constructor Create;
    229229    destructor Destroy; override;
    230     procedure UpdateScreen;
    231230    procedure UpdateActiveFormFromNativeScreen;
    232231    function DisableForms(SkipForm: TForm; DisabledList: Classes.TList = nil): Classes.TList;
    233232    procedure EnableForms(var AFormList: Classes.TList);
     233    function GetSystemDpi: Integer;
    234234    property FormCount: Integer read GetFormCount;
    235235    property Forms[Index: Integer]: TForm read GetForms;
     
    400400begin
    401401  GetNativeApplication.Initialize;
    402   Screen.UpdateScreen;
    403402end;
    404403
     
    442441      FCreatingForm := TForm(Instance);
    443442    Instance.Create(Self);
    444     Ok := true;
     443    Ok := True;
    445444  finally
    446445    if not Ok then begin
     
    978977end;
    979978
     979function TScreen.GetSystemDpi: Integer;
     980begin
     981  Result := LCLScreen.PixelsPerInch;
     982end;
     983
    980984constructor TScreen.Create;
    981985begin
     
    993997  FreeAndNil(FPrevActiveForms);
    994998  inherited;
    995 end;
    996 
    997 procedure TScreen.UpdateScreen;
    998 begin
    999   if FixedDpi = -1 then Dpi := LCLScreen.PixelsPerInch
    1000     else Dpi := FixedDpi;
    1001999end;
    10021000
Note: See TracChangeset for help on using the changeset viewer.