diff --git a/lcl/comctrls.pp b/lcl/comctrls.pp index c7027775e5..fc3b549e8f 100644 --- a/lcl/comctrls.pp +++ b/lcl/comctrls.pp @@ -3270,6 +3270,7 @@ type FMaxRight: integer; // maximum text width of all nodes (needed for horizontal scrolling) fMouseDownPos: TPoint; FMultiSelectStyle: TMultiSelectStyle; + FHotTrackColor: TColor; FOnAddition: TTVExpandedEvent; FOnAdvancedCustomDraw: TTVAdvancedCustomDrawEvent; FOnAdvancedCustomDrawItem: TTVAdvancedCustomDrawItemEvent; @@ -3490,6 +3491,7 @@ type property HideSelection: Boolean read GetHideSelection write SetHideSelection default True; property HotTrack: Boolean read GetHotTrack write SetHotTrack default False; + property HotTrackColor: TColor read FHotTrackColor write FHotTrackColor default clNone; property Indent: Integer read GetIndent write SetIndent stored IndentIsStored; property MultiSelect: Boolean read GetMultiSelect write SetMultiSelect default False; property OnAddition: TTVExpandedEvent read FOnAddition write FOnAddition; @@ -3637,6 +3639,7 @@ type property Font; property HideSelection; property HotTrack; + property HotTrackColor; property Images; property Indent; property MultiSelect; diff --git a/lcl/include/treeview.inc b/lcl/include/treeview.inc index ffad71813c..7949a49155 100644 --- a/lcl/include/treeview.inc +++ b/lcl/include/treeview.inc @@ -3269,6 +3269,7 @@ begin FTreeLinePenPattern[0] := 1; FTreeLinePenPattern[1] := 1; FExpandSignColor := clWindowFrame; + FHotTrackColor := clNone; // Accessibility AccessibleDescription := rsTTreeViewAccessibilityDescription; AccessibleRole := larTreeView; @@ -5162,6 +5163,7 @@ var Details: TThemedElementDetails; NeedUnderline: Boolean; PrevFontStyle: TFontStyles; + PrevFontColor: TColor; begin if IsSelected then begin @@ -5193,7 +5195,10 @@ var if NeedUnderline then begin PrevFontStyle := Canvas.Font.Style; + PrevFontColor := Canvas.Font.Color; Canvas.Font.Style := [fsUnderline]; + if FHotTrackColor<>clNone then + Canvas.Font.Color := FHotTrackColor; end; if (tvoThemedDraw in Options) then @@ -5202,7 +5207,10 @@ var DrawText(Canvas.Handle, PChar(AText), -1, NodeRect, DT_CENTER or DT_VCENTER or DT_SINGLELINE or DT_NOPREFIX); if NeedUnderline then + begin Canvas.Font.Style := PrevFontStyle; + Canvas.Font.Color := PrevFontColor; + end; end;