mirror of
https://github.com/HeidiSQL/HeidiSQL.git
synced 2025-08-26 11:17:57 +08:00
Data type selector: Do not set tree width to the parent column's width, which is mostly too small. Rather do an autofit on the first column so it's as wide as the text needs space.
This commit is contained in:
@ -1472,8 +1472,6 @@ begin
|
|||||||
FTreeSelect.TreeOptions.SelectionOptions := FTreeSelect.TreeOptions.SelectionOptions
|
FTreeSelect.TreeOptions.SelectionOptions := FTreeSelect.TreeOptions.SelectionOptions
|
||||||
+ [toFullRowSelect];
|
+ [toFullRowSelect];
|
||||||
FTreeSelect.Header.Columns.Add;
|
FTreeSelect.Header.Columns.Add;
|
||||||
FTreeSelect.Header.AutoSizeIndex := 0;
|
|
||||||
FTreeSelect.Header.Options := FTreeSelect.Header.Options + [hoAutoResize];
|
|
||||||
FTreeSelect.Parent := ParentControl;
|
FTreeSelect.Parent := ParentControl;
|
||||||
FTreeSelect.TextMargin := 0;
|
FTreeSelect.TextMargin := 0;
|
||||||
FTreeSelect.RootNodeCount := Length(DatatypeCategories);
|
FTreeSelect.RootNodeCount := Length(DatatypeCategories);
|
||||||
@ -1542,6 +1540,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
CatNode := FTreeSelect.GetNextSibling(CatNode);
|
CatNode := FTreeSelect.GetNextSibling(CatNode);
|
||||||
end;
|
end;
|
||||||
|
FTreeSelect.Header.AutoFitColumns(False, smaUseColumnOption, 0, 0);
|
||||||
if Assigned(FTreeSelect.FocusedNode) then
|
if Assigned(FTreeSelect.FocusedNode) then
|
||||||
FTreeSelect.ScrollIntoView(FTreeSelect.FocusedNode, True);
|
FTreeSelect.ScrollIntoView(FTreeSelect.FocusedNode, True);
|
||||||
FTreeSelect.OnFocusChanging := DoTreeSelectFocusChanging;
|
FTreeSelect.OnFocusChanging := DoTreeSelectFocusChanging;
|
||||||
@ -1598,7 +1597,7 @@ begin
|
|||||||
// Set position of tree. As the tree's parent is mainform, not listcolumns, add listcolumn's x + y positions
|
// Set position of tree. As the tree's parent is mainform, not listcolumns, add listcolumn's x + y positions
|
||||||
FTreeSelect.SetBounds(R.Left + FTree.ClientOrigin.X,
|
FTreeSelect.SetBounds(R.Left + FTree.ClientOrigin.X,
|
||||||
R.Top + FTree.ClientOrigin.Y - FTreeSelect.Header.Height - GetSystemMetrics(SM_CYMENU),
|
R.Top + FTree.ClientOrigin.Y - FTreeSelect.Header.Height - GetSystemMetrics(SM_CYMENU),
|
||||||
R.Right-R.Left,
|
FTreeSelect.Header.Columns[0].Width + GetSystemMetrics(SM_CXVSCROLL) + 5,
|
||||||
250);
|
250);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user