LCL: fixed TreeItem text is centered instead of left justified. issue #34461

git-svn-id: trunk@59647 -
This commit is contained in:
zeljko 2018-11-24 15:49:14 +00:00
parent a6491caa33
commit 5238df969e

View File

@ -5237,10 +5237,11 @@ var
Canvas.Font.Color := FHotTrackColor;
end;
NodeRect.Offset(ScaleX(2, 96), 0);
if (tvoThemedDraw in Options) then
ThemeServices.DrawText(Canvas, Details, AText, NodeRect, DT_CENTER or DT_VCENTER or DT_SINGLELINE or DT_NOPREFIX, 0)
ThemeServices.DrawText(Canvas, Details, AText, NodeRect, DT_LEFT or DT_VCENTER or DT_SINGLELINE or DT_NOPREFIX, 0)
else
DrawText(Canvas.Handle, PChar(AText), -1, NodeRect, DT_CENTER or DT_VCENTER or DT_SINGLELINE or DT_NOPREFIX);
DrawText(Canvas.Handle, PChar(AText), -1, NodeRect, DT_LEFT or DT_VCENTER or DT_SINGLELINE or DT_NOPREFIX);
if NeedUnderline then
begin
@ -5363,7 +5364,7 @@ begin
begin
CurTextRect := NodeRect;
CurTextRect.Left := x;
CurTextRect.Right := x + TextWidth(Node.Text) + RealIndent div 2;
CurTextRect.Right := x + TextWidth(Node.Text) + (FDefItemSpace * 2);
DrawNodeText(NodeSelected, CurTextRect, Node.Text);
end;