antler119 / system_tray

A Flutter package that makes it easy to customize and work with your Flutter desktop app's system tray.
MIT License
214 stars 51 forks source link

Adaptive Status Bar Icon #55

Closed smpgallagher closed 1 year ago

smpgallagher commented 1 year ago

The icon doesn't change color when the status bar changes color. In macos, you set a menuitem image from an asset to enable adaptive icons (black / white status bar toggle) Adding a channel for the following code allows for use of the asset

func setStatusBarImage( call: FlutterMethodCall, result: FlutterResult) { let assetName = call.arguments as? String if assetName != nil { statusItem?.button?.image = NSImage.init(named: assetName!) result(true) } result(false) }

Narek6556 commented 1 year ago

You need to add below line statusItem?.button?.image?.isTemplate = true

anilcngz commented 1 year ago

Have you found a solution to this issue? If so, could you share it with us? Thanks in advance