diff --git a/src/platform/windows.rs b/src/platform/windows.rs index 630ff1c03a..c5e9b967ea 100644 --- a/src/platform/windows.rs +++ b/src/platform/windows.rs @@ -17,7 +17,6 @@ use crate::{ event_loop::EventLoop, monitor::MonitorHandle, platform_impl::{EventLoop as WindowsEventLoop, Parent, WinIcon}, - system_tray::SystemTray, window::{BadIcon, Icon, Theme, Window, WindowBuilder}, }; @@ -297,11 +296,13 @@ impl IconExtWindows for Icon { } /// Additional methods on `SystemTray` that are specific to Windows. +#[cfg(feature = "tray")] pub trait SystemTrayExtWindows { fn remove(&mut self); } -impl SystemTrayExtWindows for SystemTray { +#[cfg(feature = "tray")] +impl SystemTrayExtWindows for crate::system_tray::SystemTray { /// Remove the tray icon. /// Call this when your application is goind to close, to make sure the icon is correctly removed from the system tray. fn remove(&mut self) {