TCustomLabel: fix DoDrawText selecting Font for the Canvas

git-svn-id: trunk@64191 -
This commit is contained in:
ondrej 2020-12-09 15:04:26 +00:00
parent 453f156da7
commit d7ef9f3f70

View File

@ -112,20 +112,20 @@ var
Rect2: TRect;
begin
LabelText := GetLabelText;
OldFontColor := Font.Color;
OldFontColor := Canvas.Font.Color;
if not IsEnabled and (Flags and DT_CALCRECT = 0) then
if ThemeServices.ThemesEnabled then
Font.Color := clGrayText
Canvas.Font.Color := clGrayText
else
begin
Font.Color := clBtnHighlight;
Canvas.Font.Color := clBtnHighlight;
Rect2 := Rect;
OffsetRect(Rect2, 1, 1);
DrawText(Canvas.Handle, PChar(LabelText), Length(LabelText), Rect2, Flags);
Font.Color := clBtnShadow;
Canvas.Font.Color := clBtnShadow;
end;
DrawText(Canvas.Handle, PChar(LabelText), Length(LabelText), Rect, Flags);
Font.Color := OldFontColor;
Canvas.Font.Color := OldFontColor;
end;
procedure TCustomLabel.SetAlignment(Value : TAlignment);