Skip to content

Commit

Permalink
fix: build on windows when system-tray feature is not enabled (rust-w…
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasfernog authored Jun 4, 2021
1 parent 7546dbd commit 5be88eb
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/platform/windows.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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},
};

Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 5be88eb

Please sign in to comment.