Bug 569010

Summary: TrayItem does not support dark theme on MacOS
Product: [Eclipse Project] Platform Reporter: Dennis Ju <dejuknow>
Component: SWTAssignee: Platform-SWT-Inbox <platform-swt-inbox>
Status: NEW --- QA Contact:
Severity: normal    
Priority: P3    
Version: 4.18   
Target Milestone: ---   
Hardware: Macintosh   
OS: Mac OS X   
Whiteboard:
Bug Depends on:    
Bug Blocks: 578260    
Attachments:
Description Flags
image shows a menu bar icon without and with template set to true none

Description Dennis Ju CLA 2020-11-20 18:51:06 EST
Created attachment 284831 [details]
image shows a menu bar icon without and with template set to true

In order to support both MacOS light and dark themes menu bars, Apple recommends using a template NSImage. 

According to Apple's guidelines: "A template image discards color information and uses a mask to produce the appearance you see onscreen. Template images automatically adapt to the user’s appearance settings, so they look good on both dark and light menu bars, and when your menu bar extra is selected."
https://developer.apple.com/design/human-interface-guidelines/macos/extensions/menu-bar-extras/

Recent MacOS menu bars use black/white images (though color icons are still supported). In order to support the Apple's guidelines, SWT's TrayItem should set the template property to true.
Comment 1 Dennis Ju CLA 2020-11-20 18:58:56 EST
Here is a possible fix on my own cloned repo: https://github.com/dejuknow/eclipse.platform.swt/commit/416678ea48ab25772fba5089a423912504165356