Skip to content

Commit

Permalink
Merge pull request fyne-io#4699 from gabe565/systray-use-template-icon
Browse files Browse the repository at this point in the history
Add support for template icon for system tray menu icons
  • Loading branch information
andydotxyz authored Mar 5, 2024
2 parents c3c2985 + f6607d6 commit 45cca22
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion internal/driver/glfw/driver_desktop.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,11 @@ func itemForMenuItem(i *fyne.MenuItem, parent *systray.MenuItem) *systray.MenuIt
if err != nil {
fyne.LogError("Failed to convert systray icon", err)
} else {
item.SetIcon(img)
if _, ok := i.Icon.(*theme.ThemedResource); ok {
item.SetTemplateIcon(img, img)
} else {
item.SetIcon(img)
}
}
}
return item
Expand Down

0 comments on commit 45cca22

Please sign in to comment.