From 4c167b9cbaace9fec3fac68855283a43948137f5 Mon Sep 17 00:00:00 2001 From: ondrej Date: Sun, 13 May 2018 12:51:54 +0000 Subject: [PATCH] Gtk2: bitbtn: handle glyphs only if they are really visible git-svn-id: trunk@57924 - --- lcl/interfaces/gtk2/gtk2wsbuttons.pp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lcl/interfaces/gtk2/gtk2wsbuttons.pp b/lcl/interfaces/gtk2/gtk2wsbuttons.pp index 6ac8c722e4..0675ce63b7 100644 --- a/lcl/interfaces/gtk2/gtk2wsbuttons.pp +++ b/lcl/interfaces/gtk2/gtk2wsbuttons.pp @@ -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