High DPI code enhancement: Enable TreeOptions.AutoOptions.toAutoChangeScale flag on all VirtualTrees, and remove code which did that scaling programmatically. Probably only working with the new version of VirtualTree.

This commit is contained in:
Ansgar Becker
2018-12-16 20:14:19 +01:00
parent 6bbd7d51eb
commit 8475f383dc
8 changed files with 9 additions and 22 deletions

View File

@ -1459,15 +1459,9 @@ end;
procedure FixVT(VT: TVirtualStringTree; MultiLineCount: Word=1);
var
SingleLineHeight: Integer;
Node: PVirtualNode;
begin
// Resize hardcoded node height to work with different DPI settings
VT.BeginUpdate;
SingleLineHeight := GetTextHeight(VT.Font);
VT.DefaultNodeHeight := SingleLineHeight * MultiLineCount + 5;
// The header needs slightly more height than the normal nodes
VT.Header.Height := Trunc(SingleLineHeight * 1.5);
// Apply new height to multi line grid nodes
Node := VT.GetFirstInitialized;
while Assigned(Node) do begin