diff --git a/ico.png b/ico.png new file mode 100644 index 0000000..b711c4c Binary files /dev/null and b/ico.png differ diff --git a/icon.ico b/icon.ico new file mode 100644 index 0000000..b4237ec Binary files /dev/null and b/icon.ico differ diff --git a/resources.rc b/resources.rc new file mode 100644 index 0000000..a2bc887 --- /dev/null +++ b/resources.rc @@ -0,0 +1 @@ +app-icon ICON "icon.ico" diff --git a/src/main.rs b/src/main.rs index d5e620f..d0616ff 100644 --- a/src/main.rs +++ b/src/main.rs @@ -73,14 +73,14 @@ fn main() { // Create the tray application // On Linux: empty string works as a default/no icon - // On Windows: use IconSource::Data with a 1x1 transparent icon + // On Windows: try to load icon.ico, fallback to default #[cfg(unix)] let icon_source = IconSource::Resource(""); #[cfg(windows)] - let icon_source = IconSource::Data { - rgba: &[0, 0, 0, 0], // 1x1 transparent black pixel - width: 1, - height: 1, + let icon_source = if std::path::Path::new("icon.ico").exists() { + IconSource::Resource("icon.ico") + } else { + IconSource::Resource("IDI_APPLICATION") }; let mut tray = TrayItem::new("Ambiligth", icon_source).unwrap();