mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-20 10:39:09 +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 CacheSetImageList(AImageList: TCustomImageList);
|
||||||
procedure CacheSetImageIndex(AIndex, AImageIndex: Integer);
|
procedure CacheSetImageIndex(AIndex, AImageIndex: Integer);
|
||||||
protected
|
protected
|
||||||
|
function CanShow: Boolean;
|
||||||
procedure DoChange; virtual;
|
procedure DoChange; virtual;
|
||||||
procedure GlyphChanged(Sender: TObject);
|
procedure GlyphChanged(Sender: TObject);
|
||||||
procedure SetTransparentMode(AValue: TGlyphTransparencyMode);
|
procedure SetTransparentMode(AValue: TGlyphTransparencyMode);
|
||||||
|
@ -105,7 +105,7 @@ const
|
|||||||
(gdeNormal, gdeDisabled, gdeShadowed, gdeNormal, gdeHighlighted));
|
(gdeNormal, gdeDisabled, gdeShadowed, gdeNormal, gdeHighlighted));
|
||||||
begin
|
begin
|
||||||
AUseAutoEffects := ThemeServices.GetOption(toUseGlyphEffects);
|
AUseAutoEffects := ThemeServices.GetOption(toUseGlyphEffects);
|
||||||
if Assigned(FExternalImages) then
|
if Assigned(FExternalImages) and CanShow then
|
||||||
begin
|
begin
|
||||||
AImages := FExternalImages;
|
AImages := FExternalImages;
|
||||||
AIndex := FExternalImageIndex;
|
AIndex := FExternalImageIndex;
|
||||||
@ -222,30 +222,6 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TButtonGlyph.GlyphChanged(Sender: TObject);
|
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
|
begin
|
||||||
if FImagesCache <> nil then
|
if FImagesCache <> nil then
|
||||||
begin
|
begin
|
||||||
@ -381,6 +357,29 @@ begin
|
|||||||
FImages := AImageList;
|
FImages := AImageList;
|
||||||
end;
|
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);
|
procedure TButtonGlyph.CacheSetImageIndex(AIndex, AImageIndex: Integer);
|
||||||
begin
|
begin
|
||||||
if (AIndex >= ord(Low(TButtonState))) and (AIndex <= Ord(High(TButtonState))) then
|
if (AIndex >= ord(Low(TButtonState))) and (AIndex <= Ord(High(TButtonState))) then
|
||||||
|
Loading…
Reference in New Issue
Block a user