Issue #1482: high DPI related: try to store and restore width and height of dialogs without DPI-back-calculation

This commit is contained in:
Ansgar Becker
2025-03-26 16:52:44 +01:00
parent 56b46f1b89
commit f9ce32542c
24 changed files with 150 additions and 211 deletions

View File

@ -295,12 +295,12 @@ type
constructor Create;
destructor Destroy; override;
function ReadInt(Index: TAppSettingIndex; FormatName: String=''; Default: Integer=0): Integer;
function ReadIntDpiAware(Index: TAppSettingIndex; AControl: TControl; FormatName: String=''; Default: Integer=0): Integer;
//function ReadIntDpiAware(Index: TAppSettingIndex; AControl: TControl; FormatName: String=''; Default: Integer=0): Integer;
function ReadBool(Index: TAppSettingIndex; FormatName: String=''; Default: Boolean=False): Boolean;
function ReadString(Index: TAppSettingIndex; FormatName: String=''; Default: String=''): String; overload;
function ReadString(ValueName: String): String; overload;
procedure WriteInt(Index: TAppSettingIndex; Value: Integer; FormatName: String='');
procedure WriteIntDpiAware(Index: TAppSettingIndex; AControl: TControl; Value: Integer; FormatName: String='');
//procedure WriteIntDpiAware(Index: TAppSettingIndex; AControl: TControl; Value: Integer; FormatName: String='');
procedure WriteBool(Index: TAppSettingIndex; Value: Boolean; FormatName: String='');
procedure WriteString(Index: TAppSettingIndex; Value: String; FormatName: String=''); overload;
procedure WriteString(ValueName, Value: String); overload;
@ -4185,12 +4185,12 @@ begin
end;
function TAppSettings.ReadIntDpiAware(Index: TAppSettingIndex; AControl: TControl; FormatName: String=''; Default: Integer=0): Integer;
{function TAppSettings.ReadIntDpiAware(Index: TAppSettingIndex; AControl: TControl; FormatName: String=''; Default: Integer=0): Integer;
begin
// take a forms DesignTimePPI into account
Result := ReadInt(Index, FormatName, Default);
Result := AControl.ScaleDesignToForm(Result);
end;
end;}
function TAppSettings.ReadBool(Index: TAppSettingIndex; FormatName: String=''; Default: Boolean=False): Boolean;
@ -4273,11 +4273,11 @@ begin
end;
procedure TAppSettings.WriteIntDpiAware(Index: TAppSettingIndex; AControl: TControl; Value: Integer; FormatName: String='');
{procedure TAppSettings.WriteIntDpiAware(Index: TAppSettingIndex; AControl: TControl; Value: Integer; FormatName: String='');
begin
Value := AControl.ScaleFormToDesign(Value);
WriteInt(Index, Value, FormatName);
end;
end;}
procedure TAppSettings.WriteBool(Index: TAppSettingIndex; Value: Boolean; FormatName: String='');