mirror of
https://github.com/HeidiSQL/HeidiSQL.git
synced 2025-08-06 18:24:26 +08:00
High DPI: fix growing window dimensions on each opening. Related to #378
This commit is contained in:
@ -95,8 +95,8 @@ end;
|
||||
|
||||
procedure TfrmBinEditor.FormDestroy(Sender: TObject);
|
||||
begin
|
||||
AppSettings.WriteInt(asMemoEditorWidth, Width);
|
||||
AppSettings.WriteInt(asMemoEditorHeight, Height);
|
||||
AppSettings.WriteInt(asMemoEditorWidth, Round(Width / DpiScaleFactor(Self)));
|
||||
AppSettings.WriteInt(asMemoEditorHeight, Round(Height / DpiScaleFactor(Self)));
|
||||
AppSettings.WriteBool(asMemoEditorWrap, btnWrap.Down);
|
||||
end;
|
||||
|
||||
|
@ -54,8 +54,8 @@ end;
|
||||
|
||||
procedure TColumnSelectionForm.FormDestroy(Sender: TObject);
|
||||
begin
|
||||
AppSettings.WriteInt(asColumnSelectorWidth, Width );
|
||||
AppSettings.WriteInt(asColumnSelectorHeight, Height );
|
||||
AppSettings.WriteInt(asColumnSelectorWidth, Round(Width / DpiScaleFactor(Self)));
|
||||
AppSettings.WriteInt(asColumnSelectorHeight, Round(Height / DpiScaleFactor(Self)));
|
||||
FCheckedColumns.Free;
|
||||
end;
|
||||
|
||||
|
@ -326,9 +326,9 @@ end;
|
||||
procedure Tconnform.FormDestroy(Sender: TObject);
|
||||
begin
|
||||
// Save GUI stuff
|
||||
AppSettings.WriteInt(asSessionManagerListWidth, ListSessions.Width);
|
||||
AppSettings.WriteInt(asSessionManagerWindowWidth, Width);
|
||||
AppSettings.WriteInt(asSessionManagerWindowHeight, Height);
|
||||
AppSettings.WriteInt(asSessionManagerListWidth, Round(ListSessions.Width / DpiScaleFactor(Self)));
|
||||
AppSettings.WriteInt(asSessionManagerWindowWidth, Round(Width / DpiScaleFactor(Self)));
|
||||
AppSettings.WriteInt(asSessionManagerWindowHeight, Round(Height / DpiScaleFactor(Self)));
|
||||
AppSettings.WriteInt(asSessionManagerWindowLeft, Left);
|
||||
AppSettings.WriteInt(asSessionManagerWindowTop, Top);
|
||||
MainForm.SaveListSetup(ListSessions);
|
||||
|
@ -82,8 +82,8 @@ end;
|
||||
procedure TCopyTableForm.FormDestroy(Sender: TObject);
|
||||
begin
|
||||
// Save GUI stuff
|
||||
AppSettings.WriteInt(asCopyTableWindowWidth, Width);
|
||||
AppSettings.WriteInt(asCopyTableWindowHeight, Height);
|
||||
AppSettings.WriteInt(asCopyTableWindowWidth, Round(Width / DpiScaleFactor(Self)));
|
||||
AppSettings.WriteInt(asCopyTableWindowHeight, Round(Height / DpiScaleFactor(Self)));
|
||||
end;
|
||||
|
||||
|
||||
|
@ -63,8 +63,8 @@ end;
|
||||
|
||||
procedure TfrmEditVariable.FormDestroy(Sender: TObject);
|
||||
begin
|
||||
AppSettings.WriteInt(asEditVarWindowWidth, Width);
|
||||
AppSettings.WriteInt(asEditVarWindowHeight, Height);
|
||||
AppSettings.WriteInt(asEditVarWindowWidth, Round(Width / DpiScaleFactor(Self)));
|
||||
AppSettings.WriteInt(asEditVarWindowHeight, Round(Height / DpiScaleFactor(Self)));
|
||||
end;
|
||||
|
||||
|
||||
|
@ -148,8 +148,8 @@ procedure TfrmExportGrid.FormDestroy(Sender: TObject);
|
||||
begin
|
||||
// Store settings
|
||||
if not FHiddenCopyMode then begin
|
||||
AppSettings.WriteInt(asGridExportWindowWidth, Width);
|
||||
AppSettings.WriteInt(asGridExportWindowHeight, Height);
|
||||
AppSettings.WriteInt(asGridExportWindowWidth, Round(Width / DpiScaleFactor(Self)));
|
||||
AppSettings.WriteInt(asGridExportWindowHeight, Round(Height / DpiScaleFactor(Self)));
|
||||
if ModalResult = mrOK then begin
|
||||
AppSettings.WriteBool(asGridExportOutputCopy, radioOutputCopyToClipboard.Checked);
|
||||
AppSettings.WriteBool(asGridExportOutputFile, radioOutputFile.Checked);
|
||||
|
@ -128,8 +128,8 @@ end;
|
||||
|
||||
procedure TfrmInsertFiles.FormDestroy(Sender: TObject);
|
||||
begin
|
||||
AppSettings.WriteInt(asFileImportWindowWidth, Width);
|
||||
AppSettings.WriteInt(asFileImportWindowHeight, Height);
|
||||
AppSettings.WriteInt(asFileImportWindowWidth, Round(Width / DpiScaleFactor(Self)));
|
||||
AppSettings.WriteInt(asFileImportWindowHeight, Round(Height / DpiScaleFactor(Self)));
|
||||
MainForm.SaveListSetup(ListColumns);
|
||||
MainForm.SaveListSetup(listFiles);
|
||||
end;
|
||||
|
@ -116,8 +116,8 @@ end;
|
||||
procedure Tloaddataform.FormDestroy(Sender: TObject);
|
||||
begin
|
||||
// Save settings
|
||||
AppSettings.WriteInt(asCSVImportWindowWidth, Width);
|
||||
AppSettings.WriteInt(asCSVImportWindowHeight, Height);
|
||||
AppSettings.WriteInt(asCSVImportWindowWidth, Round(Width / DpiScaleFactor(Self)));
|
||||
AppSettings.WriteInt(asCSVImportWindowHeight, Round(Height / DpiScaleFactor(Self)));
|
||||
AppSettings.WriteString(asCSVImportFilename, editFilename.Text);
|
||||
AppSettings.WriteString(asCSVImportSeparator, editFieldTerminator.Text);
|
||||
AppSettings.WriteString(asCSVImportEncloser, editFieldEncloser.Text);
|
||||
|
@ -606,8 +606,8 @@ end;
|
||||
|
||||
procedure Toptionsform.FormDestroy(Sender: TObject);
|
||||
begin
|
||||
AppSettings.WriteInt(asPreferencesWindowWidth, Width);
|
||||
AppSettings.WriteInt(asPreferencesWindowHeight, Height);
|
||||
AppSettings.WriteInt(asPreferencesWindowWidth, Round(Width / DpiScaleFactor(Self)));
|
||||
AppSettings.WriteInt(asPreferencesWindowHeight, Round(Height / DpiScaleFactor(Self)));
|
||||
end;
|
||||
|
||||
procedure Toptionsform.FormShow(Sender: TObject);
|
||||
|
@ -73,8 +73,8 @@ end;
|
||||
|
||||
procedure TfrmSelectDBObject.FormDestroy(Sender: TObject);
|
||||
begin
|
||||
AppSettings.WriteInt(asSelectDBOWindowWidth, Width);
|
||||
AppSettings.WriteInt(asSelectDBOWindowHeight, Height);
|
||||
AppSettings.WriteInt(asSelectDBOWindowWidth, Round(Width / DpiScaleFactor(Self)));
|
||||
AppSettings.WriteInt(asSelectDBOWindowHeight, Round(Height / DpiScaleFactor(Self)));
|
||||
end;
|
||||
|
||||
|
||||
|
@ -264,10 +264,10 @@ procedure TfrmSQLhelp.FormDestroy(Sender: TObject);
|
||||
begin
|
||||
AppSettings.WriteInt(asSQLHelpWindowLeft, Left );
|
||||
AppSettings.WriteInt(asSQLHelpWindowTop, Top );
|
||||
AppSettings.WriteInt(asSQLHelpWindowWidth, Width );
|
||||
AppSettings.WriteInt(asSQLHelpWindowHeight, Height );
|
||||
AppSettings.WriteInt(asSQLHelpPnlLeftWidth, pnlLeft.Width );
|
||||
AppSettings.WriteInt(asSQLHelpPnlRightTopHeight, memoDescription.Height );
|
||||
AppSettings.WriteInt(asSQLHelpWindowWidth, Round(Width / DpiScaleFactor(Self)));
|
||||
AppSettings.WriteInt(asSQLHelpWindowHeight, Round(Height / DpiScaleFactor(Self)));
|
||||
AppSettings.WriteInt(asSQLHelpPnlLeftWidth, Round(pnlLeft.Width / DpiScaleFactor(Self)));
|
||||
AppSettings.WriteInt(asSQLHelpPnlRightTopHeight, Round(memoDescription.Height / DpiScaleFactor(Self)));
|
||||
SqlHelpDialog := nil;
|
||||
end;
|
||||
|
||||
|
@ -303,9 +303,9 @@ end;
|
||||
procedure TfrmTableTools.FormDestroy(Sender: TObject);
|
||||
begin
|
||||
// Save GUI setup
|
||||
AppSettings.WriteInt(asTableToolsWindowWidth, Width );
|
||||
AppSettings.WriteInt(asTableToolsWindowHeight, Height );
|
||||
AppSettings.WriteInt(asTableToolsTreeWidth, TreeObjects.Width);
|
||||
AppSettings.WriteInt(asTableToolsWindowWidth, Round(Width / DpiScaleFactor(Self)));
|
||||
AppSettings.WriteInt(asTableToolsWindowHeight, Round(Height / DpiScaleFactor(Self)));
|
||||
AppSettings.WriteInt(asTableToolsTreeWidth, Round(TreeObjects.Width / DpiScaleFactor(Self)));
|
||||
end;
|
||||
|
||||
|
||||
|
@ -224,8 +224,8 @@ end;
|
||||
procedure TfrmTextEditor.FormDestroy(Sender: TObject);
|
||||
begin
|
||||
if WindowState <> wsMaximized then begin
|
||||
AppSettings.WriteInt(asMemoEditorWidth, Width);
|
||||
AppSettings.WriteInt(asMemoEditorHeight, Height);
|
||||
AppSettings.WriteInt(asMemoEditorWidth, Round(Width / DpiScaleFactor(Self)));
|
||||
AppSettings.WriteInt(asMemoEditorHeight, Round(Height / DpiScaleFactor(Self)));
|
||||
end;
|
||||
AppSettings.WriteBool(asMemoEditorMaximized, WindowState=wsMaximized);
|
||||
AppSettings.WriteBool(asMemoEditorWrap, btnWrap.Down);
|
||||
|
@ -224,9 +224,9 @@ end;
|
||||
procedure TUserManagerForm.FormDestroy(Sender: TObject);
|
||||
begin
|
||||
// FormDestroy: Save GUI setup
|
||||
AppSettings.WriteInt(asUsermanagerWindowWidth, Width);
|
||||
AppSettings.WriteInt(asUsermanagerWindowHeight, Height);
|
||||
AppSettings.WriteInt(asUsermanagerListWidth, pnlLeft.Width);
|
||||
AppSettings.WriteInt(asUsermanagerWindowWidth, Round(Width / DpiScaleFactor(Self)));
|
||||
AppSettings.WriteInt(asUsermanagerWindowHeight, Round(Height / DpiScaleFactor(Self)));
|
||||
AppSettings.WriteInt(asUsermanagerListWidth, Round(pnlLeft.Width / DpiScaleFactor(Self)));
|
||||
Mainform.SaveListSetup(listUsers);
|
||||
end;
|
||||
|
||||
|
Reference in New Issue
Block a user