mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-07 16:38:02 +02:00
LCL: TBitBtn: fix GlyphShowMode handling when image list is assigned. Issue #33645
git-svn-id: trunk@57714 -
This commit is contained in:
parent
8e4a25abdb
commit
733714a9cb
@ -101,6 +101,7 @@ type
|
||||
procedure CacheSetImageList(AImageList: TCustomImageList);
|
||||
procedure CacheSetImageIndex(AIndex, AImageIndex: Integer);
|
||||
protected
|
||||
function CanShow: Boolean;
|
||||
procedure DoChange; virtual;
|
||||
procedure GlyphChanged(Sender: TObject);
|
||||
procedure SetTransparentMode(AValue: TGlyphTransparencyMode);
|
||||
|
@ -105,7 +105,7 @@ const
|
||||
(gdeNormal, gdeDisabled, gdeShadowed, gdeNormal, gdeHighlighted));
|
||||
begin
|
||||
AUseAutoEffects := ThemeServices.GetOption(toUseGlyphEffects);
|
||||
if Assigned(FExternalImages) then
|
||||
if Assigned(FExternalImages) and CanShow then
|
||||
begin
|
||||
AImages := FExternalImages;
|
||||
AIndex := FExternalImageIndex;
|
||||
@ -222,30 +222,6 @@ begin
|
||||
end;
|
||||
|
||||
procedure TButtonGlyph.GlyphChanged(Sender: TObject);
|
||||
|
||||
function CanShow: Boolean;
|
||||
begin
|
||||
Result := True;
|
||||
if IsDesigning then
|
||||
Exit;
|
||||
case ShowMode of
|
||||
gsmAlways:
|
||||
Result := True;
|
||||
gsmNever:
|
||||
Result := False;
|
||||
gsmApplication:
|
||||
begin
|
||||
case Application.ShowButtonGlyphs of
|
||||
sbgAlways: Result := True;
|
||||
sbgNever: Result := False;
|
||||
sbgSystem: Result := SystemShowButtonGlyphs;
|
||||
end;
|
||||
end;
|
||||
gsmSystem:
|
||||
Result := SystemShowButtonGlyphs;
|
||||
end;
|
||||
end;
|
||||
|
||||
begin
|
||||
if FImagesCache <> nil then
|
||||
begin
|
||||
@ -381,6 +357,29 @@ begin
|
||||
FImages := AImageList;
|
||||
end;
|
||||
|
||||
function TButtonGlyph.CanShow: Boolean;
|
||||
begin
|
||||
Result := True;
|
||||
if IsDesigning then
|
||||
Exit;
|
||||
case ShowMode of
|
||||
gsmAlways:
|
||||
Result := True;
|
||||
gsmNever:
|
||||
Result := False;
|
||||
gsmApplication:
|
||||
begin
|
||||
case Application.ShowButtonGlyphs of
|
||||
sbgAlways: Result := True;
|
||||
sbgNever: Result := False;
|
||||
sbgSystem: Result := SystemShowButtonGlyphs;
|
||||
end;
|
||||
end;
|
||||
gsmSystem:
|
||||
Result := SystemShowButtonGlyphs;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TButtonGlyph.CacheSetImageIndex(AIndex, AImageIndex: Integer);
|
||||
begin
|
||||
if (AIndex >= ord(Low(TButtonState))) and (AIndex <= Ord(High(TButtonState))) then
|
||||
|
Loading…
Reference in New Issue
Block a user