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

IconSource::Data not working on macOS?

Open vlovich opened this issue 10 months ago • 2 comments

I'm feeding IconSource::Data raw ARGB pixels on macOS. The same code works on Linux but on macOS I'm not seeing the icon.

vlovich avatar Feb 07 '25 20:02 vlovich

As a workaround, feeding the IconSource::Data the raw .ico file without decoding does work. The inconsistency between platforms in the APIs is quite unfortunate. Would be nice if that were abstracted a bit better.

vlovich avatar Feb 08 '25 00:02 vlovich

@vlovich thanks for raw data tip!

I've used raw png bytes, and it worked too

const IMAGE_BYTES: &[u8] = include_bytes!("../assets/icon-256.png");

and then

let tray = TrayItem::new(
    "Tray Example",
    IconSource::Data {
      width: 256,
      height: 256,
      data: IMAGE_BYTES.into(),
    },
  )
  .unwrap();

YurySolovyov avatar Sep 21 '25 14:09 YurySolovyov