From e51bdb3e3a75e0f44040911900bee345ca786b61 Mon Sep 17 00:00:00 2001 From: blikblum Date: Tue, 29 Dec 2015 18:39:07 +0000 Subject: [PATCH] * Fix handling of default color font. Issue 29008 git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@4408 8e941d3f-bd1b-0410-a28a-d453659cc2b4 --- .../branches/4.8/VirtualTrees.pas | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/components/virtualtreeview-new/branches/4.8/VirtualTrees.pas b/components/virtualtreeview-new/branches/4.8/VirtualTrees.pas index f57c85eb3..9412505c3 100644 --- a/components/virtualtreeview-new/branches/4.8/VirtualTrees.pas +++ b/components/virtualtreeview-new/branches/4.8/VirtualTrees.pas @@ -7520,6 +7520,7 @@ procedure TVirtualTreeColumns.DrawButtonText(DC: HDC; Caption: String; Bounds: T var TextSpace: Integer; + TextColor: TColor; Size: TSize; begin @@ -7545,9 +7546,15 @@ begin else begin if Hot then - SetTextColor(DC, ColorToRGB(FHeader.Treeview.FColors.HeaderHotColor)) + TextColor := FHeader.Treeview.FColors.HeaderHotColor else - SetTextColor(DC, ColorToRGB(FHeader.FFont.Color)); + begin + if FHeader.FFont.Color = clDefault then + TextColor := clCaptionText + else + TextColor := FHeader.FFont.Color; + end; + SetTextColor(DC, ColorToRGB(TextColor)); DrawText(DC, PChar(Caption), Length(Caption), Bounds, DrawFormat); end; end; @@ -30983,6 +30990,8 @@ begin end; end; end; + if Canvas.Font.Color = clDefault then + Canvas.Font.Color := clWindowText; end; end;