Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Oct 16, 2022
Merged

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

merged 1 commit into from
Oct 16, 2022

Commits on Oct 16, 2022

  1. fix: fix icon transparency in menu items on Windows

    The current `iconToBitmap()` method in `systray_windows.go` uses the `CreateCompatibleBitmap()` Windows API [as suggested in Microsoft Learn](https://learn.microsoft.com/en-us/windows/win32/menurc/using-menus#creating-the-bitmap). But this method has a bug that makes the icon lose transparency information. This PR fixes the bug.
    
    Replace `CreateCompatibleBitmap()` with `CreateDIBSection()`. Usage from:
    
    <https://osdn.net/projects/tortoisesvn/scm/svn/commits/14191>
    
    - getlantern#207
    
    - getlantern#192
    
    - fleetdm/fleet#6924
    
    Before:
    
    ![image](https://user-images.githubusercontent.com/20179549/196026660-feb7dce0-8484-455a-a33a-a0107314568b.png)
    
    Fixed:
    
    ![image](https://user-images.githubusercontent.com/20179549/196026635-f5333664-4eac-488c-8691-2bc91b66d620.png)
    ilharp committed Oct 16, 2022
    Configuration menu
    Copy the full SHA
    f011760 View commit details
    Browse the repository at this point in the history