tray-item-rs
tray-item-rs copied to clipboard
IconSource::Data not working on macOS?
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.
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 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();