getlantern / systray

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

Icons in menu items have a black background #267

Open AlphSpirit opened 7 months ago

AlphSpirit commented 7 months ago

Referenced in #207

Here is a screenshot of the problem:

image

And here is the associated code:

func onReady() {

    iconData, err := os.ReadFile("icon/icon.ico")
    println(iconData)
    if err != nil {
        panic(err)
    }
    systray.SetTemplateIcon(iconData, iconData)
    systray.SetIcon(iconData)
    systray.SetTitle("Maitre'D MEV Service")
    systray.SetTooltip("Maitre'D MEV Service")

    titleMenuItem := systray.AddMenuItem("Maitre'D MEV Service", "Maitre'D MEV Service")
    // titleMenuItem.Disable()
    titleMenuItem.SetIcon(iconData)
    systray.AddSeparator()
    systray.AddMenuItem("Stop", "Stop the service")

}

The tray icon itself doesn't have that problem, only menu items.

I am on Windows 11 Version 23H2 Build 22631.3155

EDIT: The icon looks fine when the menu item is disabled:

image