diff --git a/source/apphelpers.pas b/source/apphelpers.pas index 72294e8b..18b2edaf 100644 --- a/source/apphelpers.pas +++ b/source/apphelpers.pas @@ -1499,24 +1499,21 @@ end; procedure FixVT(VT: TVirtualStringTree; MultiLineCount: Word=1); var - SingleLineHeight: Integer; Node: PVirtualNode; begin // This is called either in some early stage, or from preferences dialog VT.BeginUpdate; - SingleLineHeight := GetTextHeight(VT.Font) + 7; // Multiline nodes? - VT.DefaultNodeHeight := SingleLineHeight * MultiLineCount; - VT.Header.Height := SingleLineHeight; // Apply new height to multi line grid nodes Node := VT.GetFirstInitialized; while Assigned(Node) do begin - VT.NodeHeight[Node] := VT.DefaultNodeHeight; // Nodes have vsMultiLine through InitNode event VT.MultiLine[Node] := MultiLineCount > 1; Node := VT.GetNextInitialized(Node); end; VT.EndUpdate; + VT.TextMargin := 6; + VT.Margin := 2; // Disable hottracking in non-Vista mode, looks ugly in XP, but nice in Vista if (toUseExplorerTheme in VT.TreeOptions.PaintOptions) and (Win32MajorVersion >= 6) then VT.TreeOptions.PaintOptions := VT.TreeOptions.PaintOptions + [toHotTrack] diff --git a/source/connections.pas b/source/connections.pas index 830ee3dd..af392c95 100644 --- a/source/connections.pas +++ b/source/connections.pas @@ -285,6 +285,7 @@ begin HasSizeGrip := True; Caption := GetWindowCaption; + FixVT(ListSessions); ListSessions.OnCompareNodes := MainForm.AnyGridCompareNodes; ListSessions.OnHeaderClick := MainForm.AnyGridHeaderClick; ListSessions.OnHeaderDraggedOut := MainForm.AnyGridHeaderDraggedOut; @@ -398,7 +399,6 @@ begin MakeFullyVisible; pnlLeft.Width := AppSettings.ReadIntDpiAware(asSessionManagerListWidth, Self); splitterMain.OnMoved(Sender); - FixVT(ListSessions); RestoreListSetup(ListSessions); // Init sessions tree diff --git a/source/insertfiles.pas b/source/insertfiles.pas index c001f164..38e7bd89 100644 --- a/source/insertfiles.pas +++ b/source/insertfiles.pas @@ -119,6 +119,8 @@ begin HasSizeGrip := True; ListFiles.Images := GetSystemImageList; DragAcceptFiles(Handle, True); + FixVT(ListFiles); + FixVT(ListColumns); end; @@ -137,8 +139,6 @@ begin Height := AppSettings.ReadIntDpiAware(asFileImportWindowHeight, Self); RestoreListSetup(ListColumns); RestoreListSetup(ListFiles); - FixVT(ListFiles); - FixVT(ListColumns); FConnection := Mainform.ActiveConnection; Caption := FConnection.Parameters.SessionName + ' - ' + MainForm.actInsertFiles.Caption; comboDBs.Items.Clear; diff --git a/source/main.pas b/source/main.pas index 4d8cebb7..62d0be1b 100644 --- a/source/main.pas +++ b/source/main.pas @@ -2148,6 +2148,16 @@ begin end; FTimeZoneOffset := FTimeZoneOffset * 60; + // Fix node height on Virtual Trees + FixVT(DBTree); + FixVT(ListDatabases); + FixVT(ListVariables); + FixVT(ListStatus); + FixVT(ListProcesses); + FixVT(ListCommandStats); + FixVT(ListTables); + FixVT(treeQueryHelpers); + // Set noderoot for query helpers box treeQueryHelpers.RootNodeCount := 7; @@ -2836,16 +2846,6 @@ begin RestoreListSetup(ListCommandStats); RestoreListSetup(ListTables); - // Fix node height on Virtual Trees for current DPI settings - FixVT(DBTree); - FixVT(ListDatabases); - FixVT(ListVariables); - FixVT(ListStatus); - FixVT(ListProcesses); - FixVT(ListCommandStats); - FixVT(ListTables); - FixVT(treeQueryHelpers); - // Manually set focus to tree - otherwise the database filter as the first // control catches focus on startup, which is ugly. if DBtree.CanFocus then diff --git a/source/routine_editor.pas b/source/routine_editor.pas index b7f921c5..b1430c95 100644 --- a/source/routine_editor.pas +++ b/source/routine_editor.pas @@ -118,6 +118,7 @@ begin editName.MaxLength := NAME_LEN; FMainSynMemo := SynMemoBody; btnSave.Hint := ShortCutToText(MainForm.actSaveSQL.ShortCut); + FixVT(listParameters); end; @@ -126,7 +127,6 @@ var i: Integer; begin inherited; - FixVT(listParameters); TExtForm.RestoreListSetup(listParameters); if Obj.NodeType = lntProcedure then FAlterRoutineType := 'PROCEDURE' else FAlterRoutineType := 'FUNCTION'; @@ -588,3 +588,4 @@ end; end. + diff --git a/source/table_editor.pas b/source/table_editor.pas index 3c19e154..33e16fc3 100644 --- a/source/table_editor.pas +++ b/source/table_editor.pas @@ -272,6 +272,10 @@ begin editName.MaxLength := NAME_LEN; FAlterRestrictedMessageDisplayed := False; btnSave.Hint := ShortCutToText(MainForm.actSaveSQL.ShortCut); + FixVT(listColumns); + FixVT(treeIndexes); + FixVT(listForeignKeys); + FixVT(listCheckConstraints); end; @@ -283,10 +287,6 @@ begin inherited; FLoaded := False; - FixVT(listColumns); - FixVT(treeIndexes); - FixVT(listForeignKeys); - FixVT(listCheckConstraints); // Try the best to auto fit various column widths, respecting a custom DPI setting and a pulldown arrow listColumns.Header.Columns[2].Width := Mainform.Canvas.TextWidth('GEOMETRYCOLLECTION') + 6*listColumns.TextMargin; listColumns.Header.Columns[7].Width := Mainform.Canvas.TextWidth('AUTO_INCREMENT') + 4*listColumns.TextMargin; diff --git a/source/usermanager.pas b/source/usermanager.pas index 9f70b9af..7b4dd858 100644 --- a/source/usermanager.pas +++ b/source/usermanager.pas @@ -219,6 +219,8 @@ begin PrivsAdmin := Explode(',', 'RELOAD,SHUTDOWN,REPLICATION CLIENT,REPLICATION SLAVE,SUPER,LOCK TABLES,GRANT,FILE,CREATE USER,'+ 'BINLOG ADMIN,BINLOG REPLAY,CONNECTION ADMIN,FEDERATED ADMIN,READ_ONLY ADMIN,REPLICATION MASTER ADMIN,'+ 'REPLICATION SLAVE ADMIN,SET USER,SLAVE MONITOR'); + FixVT(listUsers); + FixVT(treePrivs); end; @@ -252,8 +254,6 @@ begin Width := AppSettings.ReadIntDpiAware(asUsermanagerWindowWidth, Self); Height := AppSettings.ReadIntDpiAware(asUsermanagerWindowHeight, Self); pnlLeft.Width := AppSettings.ReadIntDpiAware(asUsermanagerListWidth, Self); - FixVT(listUsers); - FixVT(treePrivs); RestoreListSetup(listUsers); FColorReadPriv := clGreen; FColorWritePriv := clMaroon;