mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-09 16:48:27 +02:00
LCL: Implement TreeView DisabledFontColor. Issue #35628, patch from Alexey Tor.
git-svn-id: trunk@61294 -
This commit is contained in:
parent
c38c503588
commit
383cc68489
@ -3332,6 +3332,7 @@ type
|
||||
fMouseDownPos: TPoint;
|
||||
FMultiSelectStyle: TMultiSelectStyle;
|
||||
FHotTrackColor: TColor;
|
||||
FDisabledFontColor: TColor;
|
||||
FOnAddition: TTVExpandedEvent;
|
||||
FOnAdvancedCustomDraw: TTVAdvancedCustomDrawEvent;
|
||||
FOnAdvancedCustomDrawItem: TTVAdvancedCustomDrawItemEvent;
|
||||
@ -3562,6 +3563,7 @@ type
|
||||
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 DisabledFontColor: TColor read FDisabledFontColor write FDisabledFontColor default clGrayText;
|
||||
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;
|
||||
@ -3701,6 +3703,7 @@ type
|
||||
property Color;
|
||||
property Constraints;
|
||||
property DefaultItemHeight;
|
||||
property DisabledFontColor;
|
||||
property DragKind;
|
||||
property DragCursor;
|
||||
property DragMode;
|
||||
|
@ -3271,6 +3271,7 @@ begin
|
||||
FTreeLinePenPattern[1] := 1;
|
||||
FExpandSignColor := clWindowFrame;
|
||||
FHotTrackColor := clNone;
|
||||
FDisabledFontColor := clGrayText;
|
||||
// Accessibility
|
||||
AccessibleDescription := rsTTreeViewAccessibilityDescription;
|
||||
AccessibleRole := larTreeView;
|
||||
@ -5239,9 +5240,17 @@ var
|
||||
|
||||
NodeRect.Offset(ScaleX(2, 96), 0);
|
||||
if (tvoThemedDraw in Options) then
|
||||
ThemeServices.DrawText(Canvas, Details, AText, NodeRect, DT_LEFT or DT_VCENTER or DT_SINGLELINE or DT_NOPREFIX, 0)
|
||||
begin
|
||||
if not Enabled then
|
||||
Details.State := 4; // TmSchema.TREIS_DISABLED = 4
|
||||
ThemeServices.DrawText(Canvas, Details, AText, NodeRect, DT_LEFT or DT_VCENTER or DT_SINGLELINE or DT_NOPREFIX, 0);
|
||||
end
|
||||
else
|
||||
begin
|
||||
if not Enabled and (FDisabledFontColor<>clNone) then
|
||||
Canvas.Font.Color := FDisabledFontColor;
|
||||
DrawText(Canvas.Handle, PChar(AText), -1, NodeRect, DT_LEFT or DT_VCENTER or DT_SINGLELINE or DT_NOPREFIX);
|
||||
end;
|
||||
|
||||
if NeedUnderline then
|
||||
begin
|
||||
|
@ -2449,6 +2449,7 @@ begin
|
||||
case Details.State of
|
||||
TREIS_SELECTED,
|
||||
TREIS_HOTSELECTED: Canvas.Font.Color := clHighlightText;
|
||||
TREIS_DISABLED: Canvas.Font.Color := clGrayText;
|
||||
TREIS_SELECTEDNOTFOCUS: Canvas.Font.Color := clBtnText;
|
||||
else
|
||||
Canvas.Font.Color := clWindowText;
|
||||
|
Loading…
Reference in New Issue
Block a user