tray-icon icon indicating copy to clipboard operation
tray-icon copied to clipboard

Colored theme reactive tray icons for MacOS

Open johnyburd opened this issue 5 months ago • 2 comments

Currently on MacOS you can set your icon as a template to have the icon change color dynamically with the bar's theme. Unfortunately this prevents using colors in your system icon since the image is used as a mask. This PR adds the ability to have colored icons that react to the system bar's theme.

Demo.webm

There is a little more clean up to do, but I figured I'd open the PR to see if it's something you're interested in merging before I spend more time on it. Please let me know if you see any major problems with this approach. I'm also open to taking a stab at implementing similar functionality for windows.

johnyburd avatar Jul 16 '25 17:07 johnyburd

something you're interested in merging

sure, why not

Please let me know if you see any major problems with this approach

nothing with the approach. but you could use more of objc2_app_kit for the is_dark logic instead of your extern C stuff similar to what winit does for example https://github.com/rust-windowing/winit/blob/e7a6034b559dfdd23a7eaa8b9bba6e88d621221b/winit-appkit/src/window_delegate.rs#L2052

FabianLars avatar Jul 16 '25 21:07 FabianLars

oh also, we'll need your commits signed to be able to merge the pr https://docs.github.com/en/authentication/managing-commit-signature-verification/signing-commits

setting that up earlier rather than later/afterwards makes your life easier.

FabianLars avatar Jul 16 '25 21:07 FabianLars