Bug 469344

Summary: KStatusNotifierItem on MacOS does not respect system theme when status=Active
Product: [Frameworks and Libraries] frameworks-knotifications Reporter: ryanadolf123
Component: generalAssignee: kdelibs bugs <kdelibs-bugs>
Status: REPORTED ---    
Severity: normal CC: kdelibs-bugs
Priority: NOR    
Version: 5.105.0   
Target Milestone: ---   
Platform: unspecified   
OS: macOS   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description ryanadolf123 2023-05-04 08:37:01 UTC
SUMMARY

On MacOS, it is customary for menu bar icons to always be in monochrome colors. Depending on the color of the wallpaper chosen for the desktop, the menu bar icons will be either black or white.

For specifically MacOS, the QT icon's isMask property is tied to whether or not the status is set to Passive/Active. I assume this behavior arose for apps which are meant to be colorful when active and monochrome while passive. However, this assumption does not hold true for apps which wish to always display in monochrome color.

Ideally, the KStatusNotifierItem should not tie the icon's isMask property to its status, but instead let the app decide how its icon should be displayed.

Another alternative would be to build in some extra APIs to help navigate systems where monochrome icons should be used. MacOS makes this easy by allowing icons to be marked as masks/templates, but on Windows one would need to recolor the icon based on system settings.

STEPS TO REPRODUCE
1. Create a new icon: `auto icon = QIcon::fromTheme(...);`
2. Set the icon to a mask: `icon.setIsMask(true);`
3. Set the KStatusNotifierItem's icon: `systray.setIconByPixmap(icon);`
4: Set the status to active: `systray.setStatus(KStatusNotifierItem::Active);`

OBSERVED RESULT

The icon is no longer marked as a mask and does not respond to the system theme.

EXPECTED RESULT

The icon should still be marked as a mask.

SOFTWARE/OS VERSIONS
Windows: 
macOS: Ventura
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 
KDE Frameworks Version: 5.105.0
Qt Version: 5

ADDITIONAL INFORMATION