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..a5daf13 100644 --- a/src/main.rs +++ b/src/main.rs @@ -73,17 +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: use IDI_APPLICATION (default app icon) to avoid resource issues #[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 = IconSource::Resource("#32512"); // IDI_APPLICATION - let mut tray = TrayItem::new("Ambiligth", icon_source).unwrap(); + let mut tray = TrayItem::new("Ambiligth", icon_source) + .expect("Failed to create tray icon. On Windows, this may require a valid icon resource."); let is_running_toggle = is_running.clone(); let restore_on_toggle = settings_arc.restore_on_exit;