fyne-io / systray

a cross platfrom Go library to place an icon and menu in the notification area
Apache License 2.0
223 stars 41 forks source link

fix: fix icon transparency in menu items on Windows #28

Closed ilharp closed 1 year ago

ilharp commented 1 year ago

Description

The current iconToBitmap() method in systray_windows.go uses the CreateCompatibleBitmap() Windows API as suggested in Microsoft Learn. But this method has a bug that makes the icon lose transparency information. This PR fixes the bug.

Solution

Replace CreateCompatibleBitmap() with CreateDIBSection(). Usage from:

https://osdn.net/projects/tortoisesvn/scm/svn/commits/14191

Related

Screenshots

Before:

image

Fixed:

image