Skip to content
Permalink
Browse files

win32: make menu glyphs automatically transparent. issue 33099

git-svn-id: https://svn.freepascal.org/svn/lazarus/trunk@57227 4005530d-fff6-0310-9dd1-cebe43e6787f
  • Loading branch information
ondrej
ondrej committed Feb 3, 2018
1 parent 1019727 commit 4ae869ad6ca2b50d032f6f005d073610c35d405d
Showing with 4 additions and 1 deletion.
  1. +4 −1 lcl/interfaces/win32/win32wsmenus.pp
@@ -1120,7 +1120,10 @@ procedure DrawMenuItemIcon(const AMenuItem: TMenuItem; const AHDC: HDC;
AImageList := TImageList.Create(nil);
AImageList.Width := AMenuItem.Bitmap.Width; // maybe height to prevent too wide bitmaps?
AImageList.Height := AMenuItem.Bitmap.Height;
AImageIndex := AImageList.Add(AMenuItem.Bitmap, nil);
if not AMenuItem.Bitmap.Transparent then
AImageIndex := AImageList.AddMasked(AMenuItem.Bitmap, AMenuItem.Bitmap.Canvas.Pixels[0, AImageList.Height-1])
else
AImageIndex := AImageList.Add(AMenuItem.Bitmap, nil);
FreeImageList := True;
end
else // using icon from ImageList

0 comments on commit 4ae869a

Please sign in to comment.
You can’t perform that action at this time.