LCL: TLabel, TPanel: draw themed grayed caption if disabled

git-svn-id: trunk@53914 -
This commit is contained in:
michl 2017-01-10 16:14:08 +00:00
parent 53014c52ff
commit 18ed0a8978
3 changed files with 19 additions and 13 deletions

View File

@ -465,11 +465,14 @@ begin
LabelText := GetLabelText;
OldFontColor := Font.Color;
if not IsEnabled then
begin
Font.Color := clBtnHighlight;
TextRect(R, TextLeft + 1, TextTop + 1, LabelText, TR);
Font.Color := clBtnShadow;
end;
if ThemeServices.ThemesEnabled then
Font.Color := clGrayText
else
begin
Font.Color := clBtnHighlight;
TextRect(R, TextLeft + 1, TextTop + 1, LabelText, TR);
Font.Color := clBtnShadow;
end;
TextRect(R, TextLeft, TextTop, LabelText, TR);
Font.Color := OldFontColor;
end;

View File

@ -139,13 +139,16 @@ begin
TS.Wordbreak := FWordWrap;
TS.SingleLine := not FWordwrap;
if not Enabled then
begin
Canvas.Font.Color := clBtnHighlight;
OffsetRect(ARect, 1, 1);
Canvas.TextRect(ARect, ARect.Left, ARect.Top, Caption, TS);
Canvas.Font.Color := clBtnShadow;
OffsetRect(ARect, -1, -1);
end
if ThemeServices.ThemesEnabled then
Canvas.Font.Color := clGrayText
else
begin
Canvas.Font.Color := clBtnHighlight;
OffsetRect(ARect, 1, 1);
Canvas.TextRect(ARect, ARect.Left, ARect.Top, Caption, TS);
Canvas.Font.Color := clBtnShadow;
OffsetRect(ARect, -1, -1);
end
else
Canvas.Font.Color := Font.Color;

View File

@ -27,7 +27,7 @@ uses
Classes, SysUtils, types,
// LCL
LCLStrConsts, LCLType, LCLProc, LCLIntf, LMessages, LResources, Graphics,
ActnList, Controls, Forms, Menus,
ActnList, Controls, Forms, Menus, Themes,
// LazUtils
TextStrings, ExtendedStrings, LazUTF8;