Skip to content

Commit eb287a6

Browse files
committed
fix: consistent DPI scaling of stored window sizes in lazarus port
1 parent ac03fad commit eb287a6

4 files changed

Lines changed: 9 additions & 9 deletions

File tree

‎source/bineditor.pas‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,8 @@ procedure TfrmBinEditor.FormCreate(Sender: TObject);
106106

107107
procedure TfrmBinEditor.FormDestroy(Sender: TObject);
108108
begin
109-
AppSettings.WriteInt(asMemoEditorWidth, Width);
110-
AppSettings.WriteInt(asMemoEditorHeight, Height);
109+
AppSettings.WriteInt(asMemoEditorWidth, ScaleFormToDesign(Width));
110+
AppSettings.WriteInt(asMemoEditorHeight, ScaleFormToDesign(Height));
111111
AppSettings.WriteBool(asMemoEditorWrap, btnWrap.Down);
112112
end;
113113

‎source/main.pas‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1854,8 +1854,8 @@ procedure TMainForm.FormDestroy(Sender: TObject);
18541854
AppSettings.WriteInt(asMainWinOnMonitor, Monitor.MonitorNum);
18551855
// Window dimensions are only valid when WindowState is normal.
18561856
if WindowState = wsNormal then begin
1857-
AppSettings.WriteInt(asMainWinLeft, ScaleFormToDesign(Left));
1858-
AppSettings.WriteInt(asMainWinTop, ScaleFormToDesign(Top));
1857+
AppSettings.WriteInt(asMainWinLeft, Left);
1858+
AppSettings.WriteInt(asMainWinTop, Top);
18591859
AppSettings.WriteInt(asMainWinWidth, ScaleFormToDesign(Width));
18601860
AppSettings.WriteInt(asMainWinHeight, ScaleFormToDesign(Height));
18611861
end;

‎source/sqlhelp.pas‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,8 @@ procedure TfrmSQLhelp.FormCreate(Sender: TObject);
112112

113113
procedure TfrmSQLhelp.FormDestroy(Sender: TObject);
114114
begin
115-
AppSettings.WriteInt(asSQLHelpWindowLeft, ScaleFormToDesign(Left));
116-
AppSettings.WriteInt(asSQLHelpWindowTop, ScaleFormToDesign(Top));
115+
AppSettings.WriteInt(asSQLHelpWindowLeft, Left);
116+
AppSettings.WriteInt(asSQLHelpWindowTop, Top);
117117
AppSettings.WriteInt(asSQLHelpWindowWidth, ScaleFormToDesign(Width));
118118
AppSettings.WriteInt(asSQLHelpWindowHeight, ScaleFormToDesign(Height));
119119
AppSettings.WriteInt(asSQLHelpPnlLeftWidth, ScaleFormToDesign(pnlLeft.Width));

‎source/tabletools.pas‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -571,9 +571,9 @@ procedure TfrmTableTools.FormClose(Sender: TObject; var Action: TCloseAction);
571571
FreeAndNil(FTargetConnection);
572572
SaveSettings;
573573
// Save GUI setup
574-
AppSettings.WriteInt(asTableToolsWindowWidth, Width);
575-
AppSettings.WriteInt(asTableToolsWindowHeight, Height);
576-
AppSettings.WriteInt(asTableToolsTreeWidth, pnlLeft.Width);
574+
AppSettings.WriteInt(asTableToolsWindowWidth, ScaleFormToDesign(Width));
575+
AppSettings.WriteInt(asTableToolsWindowHeight, ScaleFormToDesign(Height));
576+
AppSettings.WriteInt(asTableToolsTreeWidth, ScaleFormToDesign(pnlLeft.Width));
577577
end;
578578

579579

0 commit comments

Comments
 (0)