getlantern / systray

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

Icons in menu items have a black background #267

Open AlphSpirit opened 9 months ago

AlphSpirit commented 9 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

soease commented 1 month ago

The same question 。。。。。。