Gtk2: bitbtn: handle glyphs only if they are really visible

git-svn-id: trunk@57924 -
This commit is contained in:
ondrej 2018-05-13 12:51:54 +00:00
parent 0a0c499b42
commit 4c167b9cba

View File

@ -350,14 +350,14 @@ var
AEffect: TGraphicsDrawEffect;
AImageRes: TScaledImageListResolution;
begin
ShowGlyph := ABitBtn.CanShowGlyph;
ShowGlyph := ABitBtn.CanShowGlyph(True);
if ShowGlyph then
begin
ImageWidget := BitBtnInfo^.ImageWidget;
AGlyph := TBitmap.Create;
AValue.GetImageIndexAndEffect(AButtonState, ABitBtn.Font.PixelsPerInch,
ABitBtn.GetCanvasScaleFactor, AImageRes, AIndex, AEffect);
if (AIndex <> -1) and (AImageRes.Resolution <> nil) then
if (AIndex <> -1) and AImageRes.Valid then
AImageRes.GetBitmap(AIndex, AGlyph, AEffect);
ShowGlyph := not AGlyph.Empty;
if ShowGlyph then