LCL: Make TCoolBar themed background optional. Issue #30464, patch from regs.

git-svn-id: trunk@52963 -
This commit is contained in:
juha 2016-09-13 19:44:43 +00:00
parent 3463c904e7
commit 7ae08629ca
2 changed files with 17 additions and 2 deletions

View File

@ -2445,6 +2445,7 @@ type
FImageChangeLink: TChangeLink;
FOnChange: TNotifyEvent;
FShowText: Boolean;
FThemed: Boolean;
FVertical: Boolean;
FVerticalSpacing: Integer;
function GetAlign: TAlign;
@ -2457,6 +2458,7 @@ type
procedure SetHorizontalSpacing(AValue: Integer);
procedure SetImages(AValue: TCustomImageList);
procedure SetShowText(AValue: Boolean);
procedure SetThemed(AValue: Boolean);
procedure SetVertical(AValue: Boolean);
procedure SetVerticalSpacing(AValue: Integer);
protected const
@ -2523,6 +2525,7 @@ type
property HorizontalSpacing: Integer read FHorizontalSpacing write SetHorizontalSpacing default cDefHorSpacing;
property Images: TCustomImageList read FImages write SetImages;
property ShowText: Boolean read FShowText write SetShowText default True;
property Themed: Boolean read FThemed write SetThemed default True;
property Vertical: Boolean read FVertical write SetVertical default False;
property VerticalSpacing: Integer read FVerticalSpacing write SetVerticalSpacing default cDefVertSpacing;
property OnChange: TNotifyEvent read FOnChange write FOnChange;
@ -2564,6 +2567,7 @@ type
property PopupMenu;
property ShowHint;
property ShowText;
property Themed;
property Vertical;
property VerticalSpacing;
property Visible;

View File

@ -361,6 +361,7 @@ begin
FImageChangeLink := TChangeLink.Create;
FImageChangeLink.OnChange := @BitmapOrImageListChange;
FShowText := True;
FThemed := True;
FVerticalSpacing := cDefVertSpacing;
end;
@ -461,6 +462,14 @@ begin
Invalidate;
end;
procedure TCustomCoolBar.SetThemed(AValue: Boolean);
begin
if FThemed = AValue then Exit;
FThemed := AValue;
Invalidate;
end;
procedure TCustomCoolBar.SetVertical(AValue: Boolean);
var aRect: TRect;
begin
@ -1167,8 +1176,10 @@ begin
if FBitmap.Width > 0 then
DrawTiledBitmap(ClientRect, FBitmap)
else begin
aBackground:=ThemeServices.GetElementDetails(trRebarRoot);
ThemeServices.DrawElement(Canvas.Handle,aBackground,ClientRect);
if FThemed then begin
aBackground:=ThemeServices.GetElementDetails(trRebarRoot);
ThemeServices.DrawElement(Canvas.Handle,aBackground,ClientRect);
end;
end;
aCountM1 := length(FVisiBands)-1;
if aCountM1 >= 0 then begin