Issue #1482: high DPI related: call RestoreListSetup in any FormShow event, not FormCreate, move FixVT again to FormShow

This commit is contained in:
Ansgar Becker
2025-03-30 12:41:06 +02:00
parent b2b5cf6ad3
commit b266d1475e
5 changed files with 12 additions and 10 deletions

View File

@ -291,8 +291,6 @@ begin
MakeFullyVisible; MakeFullyVisible;
pnlLeft.Width := AppSettings.ReadInt(asSessionManagerListWidth); pnlLeft.Width := AppSettings.ReadInt(asSessionManagerListWidth);
splitterMain.OnMoved(Sender); splitterMain.OnMoved(Sender);
FixVT(ListSessions);
RestoreListSetup(ListSessions);
// Fix GUI stuff // Fix GUI stuff
HasSizeGrip := True; HasSizeGrip := True;
@ -401,6 +399,9 @@ var
PSess: PConnectionParameters; PSess: PConnectionParameters;
Node: PVirtualNode; Node: PVirtualNode;
begin begin
FixVT(ListSessions);
RestoreListSetup(ListSessions);
// Init sessions tree // Init sessions tree
RefreshSessions(nil); RefreshSessions(nil);

View File

@ -326,7 +326,7 @@ begin
for i := 0 to ValueList.Count - 1 do for i := 0 to ValueList.Count - 1 do
begin begin
ColWidth := MakeInt(ValueList[i]); ColWidth := MakeInt(ValueList[i]);
//ColWidth := RoundCommercial(ColWidth * OwnerForm.ScaleFactor); ColWidth := OwnerForm.ScaleDesignToForm(ColWidth);
// Check if column number exists and width is at least 1 pixel // Check if column number exists and width is at least 1 pixel
if (List.Header.Columns.Count > i) and (ColWidth > 0) and (ColWidth < 1000) then if (List.Header.Columns.Count > i) and (ColWidth > 0) and (ColWidth < 1000) then
List.Header.Columns[i].Width := ColWidth; List.Header.Columns[i].Width := ColWidth;

View File

@ -120,10 +120,6 @@ begin
//DragAcceptFiles(Handle, True); //DragAcceptFiles(Handle, True);
Width := AppSettings.ReadInt(asFileImportWindowWidth); Width := AppSettings.ReadInt(asFileImportWindowWidth);
Height := AppSettings.ReadInt(asFileImportWindowHeight); Height := AppSettings.ReadInt(asFileImportWindowHeight);
RestoreListSetup(ListColumns);
RestoreListSetup(ListFiles);
FixVT(ListFiles);
FixVT(ListColumns);
end; end;
@ -138,6 +134,10 @@ end;
procedure TfrmInsertFiles.FormShow(Sender: TObject); procedure TfrmInsertFiles.FormShow(Sender: TObject);
begin begin
RestoreListSetup(ListColumns);
RestoreListSetup(ListFiles);
FixVT(ListFiles);
FixVT(ListColumns);
FConnection := Mainform.ActiveConnection; FConnection := Mainform.ActiveConnection;
Caption := FConnection.Parameters.SessionName + ' - ' + MainForm.actInsertFiles.Caption; Caption := FConnection.Parameters.SessionName + ' - ' + MainForm.actInsertFiles.Caption;
comboDBs.Items.Clear; comboDBs.Items.Clear;

View File

@ -240,6 +240,7 @@ begin
ChildCount := Results.RecordCount; ChildCount := Results.RecordCount;
end; end;
procedure TfrmSQLhelp.treeTopicsInitNode(Sender: TBaseVirtualTree; ParentNode, procedure TfrmSQLhelp.treeTopicsInitNode(Sender: TBaseVirtualTree; ParentNode,
Node: PVirtualNode; var InitialStates: TVirtualNodeInitStates); Node: PVirtualNode; var InitialStates: TVirtualNodeInitStates);
var var

View File

@ -218,9 +218,6 @@ begin
Width := AppSettings.ReadInt(asUsermanagerWindowWidth); Width := AppSettings.ReadInt(asUsermanagerWindowWidth);
Height := AppSettings.ReadInt(asUsermanagerWindowHeight); Height := AppSettings.ReadInt(asUsermanagerWindowHeight);
pnlLeft.Width := AppSettings.ReadInt(asUsermanagerListWidth); pnlLeft.Width := AppSettings.ReadInt(asUsermanagerListWidth);
FixVT(listUsers);
FixVT(treePrivs);
RestoreListSetup(listUsers);
lblWarning.Font.Color := clRed; lblWarning.Font.Color := clRed;
PrivsRead := Explode(',', 'SELECT,SHOW VIEW,SHOW DATABASES,PROCESS,EXECUTE'); PrivsRead := Explode(',', 'SELECT,SHOW VIEW,SHOW DATABASES,PROCESS,EXECUTE');
PrivsWrite := Explode(',', 'ALTER,CREATE,DROP,DELETE,UPDATE,INSERT,ALTER ROUTINE,CREATE ROUTINE,CREATE TEMPORARY TABLES,'+ PrivsWrite := Explode(',', 'ALTER,CREATE,DROP,DELETE,UPDATE,INSERT,ALTER ROUTINE,CREATE ROUTINE,CREATE TEMPORARY TABLES,'+
@ -290,6 +287,9 @@ var
end; end;
begin begin
FixVT(listUsers);
FixVT(treePrivs);
RestoreListSetup(listUsers);
FColorReadPriv := clGreen; FColorReadPriv := clGreen;
FColorWritePriv := clMaroon; FColorWritePriv := clMaroon;
FColorAdminPriv := clNavy; FColorAdminPriv := clNavy;