lcl: draw treeitem text using appropriate themed colors

git-svn-id: trunk@24877 -
This commit is contained in:
paul 2010-04-24 14:52:22 +00:00
parent 259ffb70f6
commit 86b00d4f17
2 changed files with 10 additions and 4 deletions

View File

@ -4530,10 +4530,6 @@ var
else
Details := ThemeServices.GetElementDetails(ttItemNormal);
if ( (tvoThemedDraw in Options) or
(tvoRowSelect in Options) ) and IsSelected then
Canvas.Font.Color := InvertColor(Brush.Color);
ThemeServices.DrawText(Canvas, Details, AText, NodeRect, DT_CENTER or DT_VCENTER, 0);
end;

View File

@ -2347,6 +2347,16 @@ begin
Inc(R.Top, 1);
end;
end;
if (Details.Element = teTreeview) and (Details.Part = TVP_TREEITEM) then
begin
case Details.State of
TREIS_SELECTED,
TREIS_HOTSELECTED: Canvas.Font.Color := clHighlightText;
TREIS_SELECTEDNOTFOCUS: Canvas.Font.Color := clBtnText;
else
Canvas.Font.Color := clWindowText;
end;
end;
Canvas.TextRect(R, R.Left, R.Top, S, TXTStyle);
Canvas.Font.Color := OldColor;
end;