Work around wrongly calculated scrollbar range in host lists. Ignores hidden (= filtered) nodes now.

This commit is contained in:
Ansgar Becker
2009-04-09 22:22:38 +00:00
parent 2b8e3ac271
commit c601ece40c

View File

@ -7037,9 +7037,18 @@ begin
end else
lblFilterVTInfo.Caption := '';
// Needs a refresh to apply visible states
VT.Refresh;
VT.UpdateScrollBars(True);
// RootNode.TotalHeight needs to be recalculated so the scrollbar has the correct
// range, ignoring hidden nodes.
// Similar to what is done by VT.FixupTotalHeight() which doesn't work
// for some reason if called from within VT.UpdateVerticalScrollBar()
VT.RootNode.TotalHeight := 0;
Node := VT.GetFirst;
while Assigned(Node) do begin
if vsVisible in Node.States then
Inc(VT.RootNode.TotalHeight, Node.TotalHeight);
Node := Node.NextSibling;
end;
VT.UpdateVerticalScrollBar(True);
end;