1
0
mirror of synced 2024-06-26 07:17:40 +00:00

Added: ItemDisabledColor (musikCube painter is still not configurable enough though)

This commit is contained in:
Mark van Renswoude 2010-03-17 11:20:40 +00:00
parent fe5574b9e9
commit 6b13daa2dc

View File

@ -83,6 +83,7 @@ type
FIndicatorColors: TX2MenuBarmCColors;
FItemColors: TX2MenuBarmCColors;
FItemHeight: Integer;
FItemDisabledColor: TColor;
procedure SetColor(const Value: TColor);
procedure SetGroupColors(const Value: TX2MenuBarmCColors);
@ -90,6 +91,7 @@ type
procedure SetIndicatorColors(const Value: TX2MenuBarmCColors);
procedure SetItemColors(const Value: TX2MenuBarmCColors);
procedure SetItemHeight(const Value: Integer);
procedure SetItemDisabledColor(const Value: TColor);
protected
procedure ColorChange(Sender: TObject);
@ -114,6 +116,7 @@ type
property IndicatorColors: TX2MenuBarmCColors read FIndicatorColors write SetIndicatorColors stored False;
property ItemColors: TX2MenuBarmCColors read FItemColors write SetItemColors stored False;
property ItemHeight: Integer read FItemHeight write SetItemHeight stored False;
property ItemDisabledColor: TColor read FItemDisabledColor write SetItemDisabledColor stored False;
end;
implementation
@ -127,6 +130,7 @@ begin
inherited;
FColor := clBtnFace;
FItemDisabledColor := clGrayText;
FGroupColors := TX2MenuBarmCColors.Create;
FGroupHeight := 22;
FIndicatorColors := TX2MenuBarmCColors.Create;
@ -341,6 +345,11 @@ begin
Inc(textBounds.Left, imageList.Width + 4);
end;
if AItem.Enabled then
ACanvas.Font.Color := clWindowText
else
ACanvas.Font.Color := ItemDisabledColor;
if not AItem.Visible then
{ Design-time }
ACanvas.Font.Style := [fsItalic]
@ -378,6 +387,15 @@ begin
end;
end;
procedure TX2MenuBarmusikCubePainter.SetItemDisabledColor(const Value: TColor);
begin
if Value <> FItemDisabledColor then
begin
FItemDisabledColor := Value;
NotifyObservers;
end;
end;
procedure TX2MenuBarmusikCubePainter.SetItemHeight(const Value: Integer);
begin
if Value <> FItemHeight then