mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-25 00:39:28 +02:00
LCL: TLabel, TPanel: draw themed grayed caption if disabled
git-svn-id: trunk@53914 -
This commit is contained in:
parent
53014c52ff
commit
18ed0a8978
@ -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;
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user